Run Multiple Servers On One Machine.

G_I_JoehosaphatG_I_Joehosaphat Join Date: 2003-02-03 Member: 13068Members
Question is, whats the best way to run multiple HLDS servers on one linux machine? Is it better to have multiple installs of HLDS in different directories? I really just want to run the NS server I have, as well as a CS and possibly DoD server at the same time.

Mostly just not sure if running multiple instances of the one HLDS install will cause conflicts, or whether it matters at all. Would running each Mod as a different user fix any possible conflicts with just one HLDS install? Also, can I setup Linux so that one Mod has CPU priority over another less important(to me) Mod?

If, multiple HLDS installs is required, or recommended, what do you recommend for a directory structure setup? Currently I have the default '/hlds/hlds_l/modnamehere'

Ok, lotsa questions in there, looking forward to some insight <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo--> Thanks!

G.I.

Comments

  • PTMarsPTMars Join Date: 2003-04-26 Member: 15862Members
    We set ours up in a folder titled hlds_hosting/UserName/hlds_l

    For the servers we use that are for OUR clan we just run them all from the same hlds_l folder.

    You can use NICE to specify which instances of hlds get more proc time as well.
  • SpurtySpurty Join Date: 2002-11-16 Member: 8944Members, Constellation
    Yeah, make sure you backup a good virgin copy to clone and hack.

    Never HACK your original, it will save you LOTS of greyhairs (If you haven't pulled them out already)

    Not sure what you are running for a server, but I have a Dual Xeon 1.8Ghz with 1Gig of RAM and it can run NS 2.0 (16 players) and CS 1.6 (16 players) ok.

    Any additional servers makes the existing two wobble <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif'><!--endemo-->
  • Pebbles-TPFPebbles-TPF Join Date: 2002-11-11 Member: 8237Members, Constellation
    server.counter-strike.net

    <i>Pebbs</i>
  • G_I_JoehosaphatG_I_Joehosaphat Join Date: 2003-02-03 Member: 13068Members
    Thanks for the info.

    I'll go at it this weekend.

    What was the link to <a href='http://server.counter-strike.net' target='_blank'>http://server.counter-strike.net</a> for? Theres nothing I could find that has anything to do with running multiple instances of HLDS. Its a big site, was it under a particular link? Hidden on some page somewhere?

    G.I.
  • Pebbles-TPFPebbles-TPF Join Date: 2002-11-11 Member: 8237Members, Constellation
    <a href='http://server.counter-strike.net/server.php?cmd=howto&show=screen' target='_blank'>http://server.counter-strike.net/server.ph...wto&show=screen</a>

    With creativity, you can use that to run multiple instances of the servers.

    <a href='http://server.counter-strike.net/server.php?cmd=howto&show=linux' target='_blank'>http://server.counter-strike.net/server.ph...owto&show=linux</a>

    Has something about running different mods on the same box.

    <i>Pebbs</i>
  • G_I_JoehosaphatG_I_Joehosaphat Join Date: 2003-02-03 Member: 13068Members
    Oh I see.

    I already knew *how* to run multiple instances of something and switch between. I was more looking for whether it was a good idea, or a better solution to have mutiple installs of HLDS. <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->

    But good info either way, thanks.

    G.I.
  • Pebbles-TPFPebbles-TPF Join Date: 2002-11-11 Member: 8237Members, Constellation
    multiple installs of hlds_l is a better solution if you can spare the disk space.

    <i>Pebbs</i>
  • HKHereticHKHeretic Join Date: 2003-02-23 Member: 13859Members
    edited August 2003
    <!--QuoteBegin--Pebbles-TPF-+Aug 19 2003, 05:59 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Pebbles-TPF- @ Aug 19 2003, 05:59 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> multiple installs of hlds_l is a better solution if you can spare the disk space.

    <i>Pebbs</i> <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    I would disagree with this. Or, if you do, make sure to symlink all the executables and .so files such that only one of each is used. This will increase performance. Why? Because they're all sharing the same virtual memory mapped code space. It'll make much better use of your processor's cache. Very important for running multiple copies of the same process performance wise.

    As a small side benefit, you'll probably save a bit on RAM and disk.

    We currently run 2 CS servers (12 and 16 player) and 1 22 person NS server and they all run just dandy on our setup. We are even thinking of running 2 (possibly 3) 16 player NS servers instead of 1 22-player server as that would probably be LESS CPU load. CPU load is a far-worse than linear increase with player count. With <12 players on NS, we barely register 1% CPU usage.
  • auxiliaryauxiliary Join Date: 2003-08-07 Member: 19160Members
    edited August 2003
    edit - nm <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
  • The_MAzTerThe_MAzTer Join Date: 2003-01-04 Member: 11784Members, Constellation
    hmm..

    are the log files not **** when u run 2x hlds from same folder?

    i preffer to use multiple installs or shortcuts then useing 1 folder.
  • Pebbles-TPFPebbles-TPF Join Date: 2002-11-11 Member: 8237Members, Constellation
    <!--QuoteBegin--[HK]Heretic+Aug 19 2003, 06:46 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> ([HK]Heretic @ Aug 19 2003, 06:46 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I would disagree with this. Or, if you do, make sure to symlink all the executables and .so files such that only one of each is used. This will increase performance. Why? Because they're all sharing the same virtual memory mapped code space. It'll make much better use of your processor's cache. Very important for running multiple copies of the same process performance wise.

    As a small side benefit, you'll probably save a bit on RAM and disk.

    We currently run 2 CS servers (12 and 16 player) and 1 22 person NS server and they all run just dandy on our setup. We are even thinking of running 2 (possibly 3) 16 player NS servers instead of 1 22-player server as that would probably be LESS CPU load. CPU load is a far-worse than linear increase with player count. With <12 players on NS, we barely register 1% CPU usage. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    The problemn with this setup is that when something happens like last night, and one of your mods corrupts your executable, you have to reinstall all the mods and the hlds_l.

    The stability issue far outweighs the resource issue in my mind. I don't care if one server is down. but when all 4 are down it becomes a serious pain.

    <i>Pebbs</i>
  • PTMarsPTMars Join Date: 2003-04-26 Member: 15862Members
    Why would you need to reinstall all of your mods?

    Just tar the hlds and you are done.
  • Pebbles-TPFPebbles-TPF Join Date: 2002-11-11 Member: 8237Members, Constellation
    <!--QuoteBegin--PT|Mars+Aug 21 2003, 02:59 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (PT|Mars @ Aug 21 2003, 02:59 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Why would you need to reinstall all of your mods?

    Just tar the hlds and you are done. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    I did. That did not work.

    I decided to back up all config files at that point and do clean re-installs of all the mods. The problem came about with the hlds_1686.so module corrupting when the CS and NS servers were started up. So I decided to seperate them and do a re-install.

    <i>Pebbs</i>
  • PTMarsPTMars Join Date: 2003-04-26 Member: 15862Members
    Weird.

    We've never had any server files corrupt...

    <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif'><!--endemo-->
  • G_I_JoehosaphatG_I_Joehosaphat Join Date: 2003-02-03 Member: 13068Members
    Anyone recognize this error? It spams over and over when viewing the server console.

    sleep: error while loading shared libraries: ./boffix_i386.so: cannot open shared object file: No such file or directory
    /hlds2/hlds_l/hlds_run: ./hlds: is a directory
    Add "-debug" to the /hlds2/hlds_l/hlds_run command line to generate a debug.log to help with solving this problem

    I got this attempting to start a second server, in a totally new HLDS install. The boffix file is the fix for the 3110 exploit. I can "uninstall" the fix, but the the server is vulnerable <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo--> The file is in the correct place and the hlds_run file is correctly pointing to it. I've double and triple checked that its pointing correctly using my original HLDS install as reference(the original runs without hiccup). Its probably something simple I'm overlooking, as is typical. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->

    G.I.
  • PTMarsPTMars Join Date: 2003-04-26 Member: 15862Members
    Did you export the library path?
  • G_I_JoehosaphatG_I_Joehosaphat Join Date: 2003-02-03 Member: 13068Members
    This is the first command after #!/bin/sh in the hlds_run file.

    export LD_PRELOAD=./boffix_i386.so

    So, yea <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->

    Hmm, but good point I'll look into changing this so it actually points to the boffix file starting from the the / directory.

    G.I.
  • HKHereticHKHeretic Join Date: 2003-02-23 Member: 13859Members
    <!--QuoteBegin--G.I.Joehosaphat+Aug 22 2003, 05:45 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (G.I.Joehosaphat @ Aug 22 2003, 05:45 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> This is the first command after #!/bin/sh in the hlds_run file.

    export LD_PRELOAD=./boffix_i386.so

    So, yea <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->

    Hmm, but good point I'll look into changing this so it actually points to the boffix file starting from the the / directory.

    G.I. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    Yea, try the absolute path. If you symlinked to a file in a symlinked directory, that'll often cause problems.
  • HKHereticHKHeretic Join Date: 2003-02-23 Member: 13859Members
    edited August 2003
    <!--QuoteBegin--Pebbles-TPF-+Aug 21 2003, 09:18 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Pebbles-TPF- @ Aug 21 2003, 09:18 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->The problemn with this setup is that when something happens like last night, and one of your mods corrupts your executable, you have to reinstall all the mods and the hlds_l.

    The stability issue far outweighs the resource issue in my mind. I don't care if one server is down. but when all 4 are down it becomes a serious pain.

    <i>Pebbs</i> <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Odd... In the 2.5 years I've run hlds_l servers, I've never heard/seen that happen. Have you thought about removing write permissions to all the binary files? That way you wouldn't have to worry about your server currupting itself. Which mod currupted your executable anyway?

    From testing, the performance difference when all servers are loaded is far from neglible on my setup--due in large part to the pentium4 host CPU. I'm an efficiency freak, I like pings in the teens with the server loaded.

    Stability is what I value most as well.

    <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->top - 15:00:06 <b>up 146 days</b>, 20:53,  1 user,  load average: 0.29, 0.25, 0.24
    Tasks: 107 total,   5 running, 102 sleeping,   0 stopped,   0 zombie
    Cpu(s):  41.5% user,   1.7% system,   0.0% nice,  56.8% idle
    Mem:   1033472k total,  1002768k used,    30704k free,   122692k buffers
    Swap:   530136k total,    88828k used,   441308k free,   540768k cached

      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    <b>TIME+</b>  Command
    30267 gameserv  15   0  110m  86m 5228 R 39.4  8.6   <b>01570:29</b> hlds<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    That's after 133 map changes.

    The only reason the NS server goes down now, is when people exploit buffer overflows--some still exist. <a href='http://www.clanhk.org/crash.txt' target='_blank'>This is a log of someone that DOS'd our server a few times</a>. I ended up banning filtering subnet at the firewall (iptables).
  • Pebbles-TPFPebbles-TPF Join Date: 2002-11-11 Member: 8237Members, Constellation
    <!--QuoteBegin--[HK]Heretic+Aug 23 2003, 03:12 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> ([HK]Heretic @ Aug 23 2003, 03:12 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Odd... In the 2.5 years I've run hlds_l servers, I've never heard/seen that happen. Have you thought about removing write permissions to all the binary files? That way you wouldn't have to worry about your server currupting itself. Which mod currupted your executable anyway? <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    Yes, however that was not the problem.

    There are two admins on our server (another fellow and myself), and he had upgraded our version of red hat from 8.0 to 9.0 and updated the kernel as well. Now this should not be the problem BUT, it may have caused it because he ran a TFC server as root to tesr that the upgrade had worked. I suspect this is where things went wrong. But don't quote me on that. I cannot simulate that type of bug, and I'd prefer not to.

    By the way, how do you get such low usage on your server? I get this from top -d5:
    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    16:39:56  up 3 days, 22:44,  2 users,  load average: 0.99, 0.85, 0.78
    54 processes: 53 sleeping, 1 running, 0 zombie, 0 stopped
    CPU0 states:   4.16% user   1.8% system    0.0% nice   0.0% iowait  93.14% idle
    CPU1 states:  15.1% user   1.17% system    0.0% nice   0.0% iowait  83.0% idle
    CPU2 states:  42.8% user   2.16% system    0.0% nice   0.0% iowait  54.14% idle
    CPU3 states:   2.3% user   0.13% system    0.0% nice   0.0% iowait  97.3% idle
    Mem:  1030560k av, 1017316k used,   13244k free,       0k shrd,   13956k buff
                       605912k actv,  259148k in_d,  109728k in_c
    Swap: 2048276k av,     804k used, 2047472k free                  661996k cached

     PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
     687 hlserver  15   0 88988  86M  3648 S    46.0  8.6  1543m   2 hlds
    10644 hlserver  15   0 96676  94M  5344 S    11.7  9.3 261:29   3 hlds_i686
    10581 hlserver  15   0 57424  56M  4828 S     5.8  5.5 146:08   1 hlds_i686
    13946 hlserver  15   0 69268  67M  4880 S     4.9  6.7  93:09   1 hlds
    <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    What type of rig do you have? and what are you using it for? This is a dual Xeon, with 1 GB of ram that we are running NS on. The other 3 hlds* processes are a DoD server and 2 CS servers. No, we don't get ping spikes on our server at the moment. We're trying really hard to get 60 concurrent players on, but till now we have only managed 57... if we could get 80 I would be extatic!

    While I am at it, Heretic, would you mind posting some of your minimalist tricks? If I can make our servers work better, then I'll be even happier <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif'><!--endemo-->

    <i>Pebbs</i>
Sign In or Register to comment.