[cod] Multiple COD:UO servers on the same box

Mark J. DeFilippis defilm at acm.org
Thu Dec 9 07:45:20 EST 2004


See below:


At 03:55 AM 12/9/2004, you wrote:
>I would rather use screen than nohup. preventing oneself from getting
>access to the console is something at least I wouldnt recommend.
>
>screen -dmS ./cod_lnxded +set net_ip xxx +set net_port xxx +set
>sv_punkbuster 1 +set dedicated 2 +exec server.cfg
>
>screen -list
>
>screen -r PID
>
>Just my 2 cents, and rather than sym-links, try hardlinks for all the
>pk3 files, and create actual copies of the binaries to each instance
>rather than sym-linking.  Or you can chmod the main binary so that
>each execution of it will start itself in its own memory space and not
>clobber other games running the same binary in the same memory space.


You have been getting some excellent advice and wonderful help.
Was doing great, up until this part here.  (BTW, I also use screen,
is it more reliable than nohup.  nohup protects against a Hangup signal
(-15), and there are other signs you wish to protect against. In addition,
I have seen instances, depending on execution scheduling, where the
executable WILL receive a HUP signal if you terminate the shell prior
to it disassociating the controlling terminal from the process. (See nohup(1))
(In simpler terms, a nohup is simply fork(2)s a child, turns off certain signal
processing, and then disassociates itself from your shell process, making its
parent process your shell's parent process which is often process 1 init.

With regards to copying executables, or using the same code. PLEASE
use the same executable. You can use a hardlink if on the same filesystem,
(otherwise a ln will copy the file anyway), or symbolic. I recommend the hard
link.  In addition, set the sticky bit on the executable.

This will induce less lag, as the executable is, on execution, copied to swap
space only once for ALL instances, and not each time it is spawned. In addition
depending on the number of instances, there is a memory savings.

Linux will share text pages, however your Heap and Stack will be allocated in a
separate memory segment.  If a process sharing an executable attempts to
write said executable, a fork_on_write(2) will be executed. (See vmstat(1))
Thus, if a single process goes hog wild, it will NOT impact readonly text (aka
code) (other processes sharing the same readonly text), at all.

This does not mean if you have a BUG in the code, and one process hits
it, and goes in to a spin loop it won't impact your other processes. In fact,
regardless of what you do, if you have that type of bug, the result will be
the same whether you are running the same code or two executables.

Loading the text pages in to memory once saves memory, and has NO
negative impact at all.  I spent much of my early career writing kernel code
so I know all too often how this works.  (Yes... Multi-threaded link libraries
especially!)

But take all the other good stuff people have been providing to you. They
know their stuff. (Scripts even!  can't get better than that!!)  Keep them 
coming...
I just grabbed another Dual P4 3.0, and am migrating off two older single
pents. I am lazy and given a stub of code.... heck, Ill use it! ;-))

Good luck to you.






>On Wed, 8 Dec 2004 13:17:06 -0600, Jay Vasallo <jayco1 at charter.net> wrote:
> > Good question. I am waiting for the linux version also. I am not sure about
> > the homiepath in MOH-PA. I know if it has PB within the code, it will have
> > the homepath. Sorry i can't be of much help.
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "hotrod deathtoll" <hotrod_death_toll at yahoo.com>
> > To: <cod at icculus.org>
> > Sent: Wednesday, December 08, 2004 1:05 PM
> > Subject: Re: [cod] Multiple COD:UO servers on the same box
> >
> > > Okay I didn't realize the command line switches
> > > fs_basepath and fs_homepath existed.  That rocks!!  Do
> > > those command line switches work in MOHAA:SH too?
> > > Sorry for the MOH ques on the cod page but my server
> > > is running both.
> > >
> > > John
> > >
> > > --- Jay Vasallo <jayco1 at charter.net> wrote:
> > >
> > >> You can always keep the lines nice and short and
> > >> just end the line with a forwared slash \ .
> > >>
> > >> Example
> > >>
> > >> nohup ./cod_lnxded +set fs_basepath /usr/games/cod
> > >> +set fs_homepath /home/hyppe/cod \
> > >> +exec tdm_mp.cfg +set dedicated 2 +map_rotate +set
> > >> net_ip xxx.xxx.xxx.xxx \
> > >>
> > >> What happens if you make a mistake and the mistake
> > >> is on the start up line and you can't see it cause
> > >> it is scrolled off the screen? This way you can see
> > >> all lines in front of you at all times
> > >>
> > >> =o)
> > >>
> > >>
> > >>
> > >>   ----- Original Message -----
> > >>   From: Fredric Ollikala
> > >>   To: cod at icculus.org
> > >>   Sent: Wednesday, December 08, 2004 12:02 PM
> > >>   Subject: Re: [cod] Multiple COD:UO servers on the
> > >> same box
> > >>
> > >>
> > >>   My question too. Below is an example what one of
> > >> my startup scripts looks like.
> > >>
> > >>   #!/bin/sh
> > >>   #
> > >>   # cod startup script
> > >>   #
> > >>
> > >>   cd /usr/games/cod
> > >>
> > >>   nohup ./cod_lnxded +set fs_basepath /usr/games/cod
> > >> +set fs_homepath /home/hyppe/cod +exec tdm_mp.cfg
> > >> +set dedicated 2 +map_rotate +set net_ip
> > >> xxx.xxx.xxx.xxx +set net_port 28960 >/dev/null 2>&1
> > >> &  <--- should be on the same line as above, the
> > >> line was too long and was cut into 2.
> > >>   ps ax |grep tdm_mp.cfg |grep -v grep |awk '{print
> > >> $1;}' > /home/hyppe/cod/pid.tdmcod
> > >>
> > >>   exit 0
> > >>
> > >>   fs_basepath is where the game is installed.
> > >>   fs_homepath is where all user configfiles,
> > >> logfiles, mods and so on goes.
> > >>
> > >>
> > >>   Just put the text in a file called "codtdm" or
> > >> whatever and do "chmod +x codtdm". To execute it
> > >> just type ./codtdm
> > >>   This will launch the server into the background
> > >> and also create a file containing the server pid
> > >> (process id).
> > >>
> > >>   I use another script that runs every 10 minutes
> > >> using Crontab, to check if the server is still
> > >> running, if not it will be restarted executing the
> > >> script above.
> > >>
> > >>   Best regards:
> > >>
> > >>   Fredric Ollikkala
> > >>
> > >>
> > >>
> > >>   ----- Original Message -----
> > >>   From: "Jay Vasallo" <jayco1 at charter.net>
> > >>   To: <cod at icculus.org>
> > >>   Sent: Wednesday, December 08, 2004 6:41 PM
> > >>   Subject: Re: [cod] Multiple COD:UO servers on the
> > >> same box
> > >>
> > >>
> > >>   > Symlink? Why?
> > >>   >
> > >>   >
> > >>   >
> > >>   > ----- Original Message -----
> > >>   > From: "hotrod deathtoll"
> > >> <hotrod_death_toll at yahoo.com>
> > >>   > To: <cod at icculus.org>
> > >>   > Sent: Wednesday, December 08, 2004 11:37 AM
> > >>   > Subject: RE: [cod] Multiple COD:UO servers on
> > >> the same box
> > >>   >
> > >>   >
> > >>   >> Thanks David.  That's what I wanted to know
> > >> because I
> > >>   >> wanted to keep it clean like you guys are
> > >> running
> > >>   >> yours.
> > >>   >>
> > >>   >> Thanks again.
> > >>   >>
> > >>   >> John
> > >>   >>
> > >>   >> --- david at fuess.net wrote:
> > >>   >>
> > >>   >>> That's how our servers are setup. We have a
> > >> common
> > >>   >>> install location for
> > >>   >>> all games, then symlink the shared components
> > >> into
> > >>   >>> each games' home
> > >>   >>> directory. The configuration files are local
> > >> to the
> > >>   >>> game so you can run
> > >>   >>> different configs on each game server if you
> > >> like.
> > >>   >>> We normally designate
> > >>   >>> one a Public server that we keep "stock", one
> > >> a
> > >>   >>> "Custom" server that may
> > >>   >>> have custom mods or maps, and another a
> > >> "Match"
> > >>   >>> server that is
> > >>   >>> configured in accordance with the rules of the
> > >>   >>> competition league (TWL,
> > >>   >>> OGL, whatever).
> > >>   >>>
> > >>   >>> Dave
> > >>   >>>
> > >>   >>> > -------- Original Message --------
> > >>   >>> > Subject: RE: [cod] Multiple COD:UO servers
> > >> on the
> > >>   >>> same box
> > >>   >>> > From: "Darren Rathbone"
> > >> <darren at rathbone.org.uk>
> > >>   >>> > Date: Tue, December 07, 2004 6:38 am
> > >>   >>> > To: cod at icculus.org
> > >>   >>> >
> > >>   >>> > Certainly can, as long as the servers are
> > >> using
> > >>   >>> different ports and/or IPs
> > >>   >>> >
> > >>   >>> > Rgds
> > >>   >>> > PapaLaz
> > >>   >>> > {tTs.}'TechSpot.co.uk
> > >>   >>> >
> > >>   >>> > -----Original Message-----
> > >>   >>> > From: hotrod deathtoll
> > >>   >>> [mailto:hotrod_death_toll at yahoo.com]
> > >>   >>> > Sent: 07 December 2004 14:34
> > >>   >>> > To: cod at icculus.org
> > >>   >>> > Subject: [cod] Multiple COD:UO servers on
> > >> the same
> > >>   >>> box
> > >>   >>> >
> > >>   >>> > Can you have two gameserver processes use
> > >> the same
> > >>   >>> > binaries and .pk3's without any problem??
> > >>   >>> >
> > >>   >>> >
> > >>   >>> >
> > >>   >>> > __________________________________
> > >>   >>> > Do you Yahoo!?
> > >>   >>> > Yahoo! Mail - Helps protect you from nasty
> > >>   >>> viruses.
> > >>   >>> > http://promotions.yahoo.com/new_mail
> > >>   >>>
> > >>   >>>
> > >>   >>
> > >>   >>
> > >>   >>
> > >>   >>
> > >>   >> __________________________________
> > >>   >> Do you Yahoo!?
> > >>   >> Read only the mail you want - Yahoo! Mail
> > >> SpamGuard.
> > >>   >> http://promotions.yahoo.com/new_mail
> > >>   >>
> > >>   >
> > >>   >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> >
 >
S2----------------------------------------------------------------------------------
Mark J. DeFilippis,  Ph. D EE                    defilm at acm.org
                                                                defilm at ieee.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/cod/attachments/20041209/446b29ac/attachment.htm>


More information about the Cod mailing list