Server question CPU usage

AssassinY2KAssassinY2K Join Date: 2002-11-09 Member: 7931Members, Reinforced - Supporter
edited August 2011 in NS2 General Discussion
With no players on the server it is using 5~6% of the CPU, as soon as 1 person joins it jumps to 100% CPU usage.

I set player limit to 12 on summit map

I am using a Dell PowerEdge 1950
2 x Dual-Core XEON 5160 3.0Ghz Processors
16Gb Ram
2 x 73Gb SAS 10k 2.5" HDD's
Windows Server 2008 x64

What is causing it to use so much? Am I missing a setting somewhere?

When I joined, tick rate was a stable 30, but when I filled the 12 slots with bots, it went down to 20~24 tick rate, thats with about 20 sentry guns and several buildings

Comments

  • RichardRahlRichardRahl Join Date: 2011-06-15 Member: 104594Members
    edited August 2011
    <!--quoteo(post=1868238:date=Aug 10 2011, 07:08 PM:name=AssassinY2K)--><div class='quotetop'>QUOTE (AssassinY2K @ Aug 10 2011, 07:08 PM) <a href="index.php?act=findpost&pid=1868238"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->With no players on the server it is using 5~6% of the CPU, as soon as 1 person joins it jumps to 100% CPU usage.

    I set player limit to 12 on summit map

    I am using a Dell PowerEdge 1950
    2 x Dual-Core XEON 5160 3.0Ghz Processors
    16Gb Ram
    2 x 73Gb SAS 10k 2.5" HDD's
    Windows Server 2008 x64

    What is causing it to use so much? Am I missing a setting somewhere?

    When I joined, tick rate was a stable 30, but when I filled the 12 slots with bots, it went down to 20~24 tick rate, thats with about 20 sentry guns and several buildings<!--QuoteEnd--></div><!--QuoteEEnd-->

    a dual core seems kind of weak for a server, that probably explains why.
  • AssassinY2KAssassinY2K Join Date: 2002-11-09 Member: 7931Members, Reinforced - Supporter
    edited August 2011
    <!--quoteo(post=1868240:date=Aug 11 2011, 12:15 AM:name=RichardRahl)--><div class='quotetop'>QUOTE (RichardRahl @ Aug 11 2011, 12:15 AM) <a href="index.php?act=findpost&pid=1868240"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->a dual core seems kind of weak for a server, that probably explains why.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Ns2 server.exe only uses 1 core...
  • RichardRahlRichardRahl Join Date: 2011-06-15 Member: 104594Members
    hm strange, it's a newer processor no?
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    I think this is just the state of NS2 right now. The only servers that seem like they can handle it right now are the i5/i7's pushing 3.5-4.0GHz. The only thing I can suggest is to try dedicating NS2 to the 2nd core so it isn't to run other programs+NS2 on the same core.
  • AssassinY2KAssassinY2K Join Date: 2002-11-09 Member: 7931Members, Reinforced - Supporter
    edited August 2011
    <!--quoteo(post=1868256:date=Aug 11 2011, 03:21 AM:name=ScardyBob)--><div class='quotetop'>QUOTE (ScardyBob @ Aug 11 2011, 03:21 AM) <a href="index.php?act=findpost&pid=1868256"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think this is just the state of NS2 right now. The only servers that seem like they can handle it right now are the i5/i7's pushing 3.5-4.0GHz. The only thing I can suggest is to try dedicating NS2 to the 2nd core so it isn't to run other programs+NS2 on the same core.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I would have to agree, I set CPU affinity to the 2nd CPU (no programs) and got the same result
  • SewlekSewlek The programmer previously known as Schimmel Join Date: 2003-05-13 Member: 16247Members, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Developer
    hi, this is not really cpu usage related problem, but i thought i could still ask here:

    I'm having a problem with starting a dedicated server. Once up, you can see it in the server list and also connect, but after 1-2 minutes it disappears. Port is forwarded correctly (27014 - 27016 to keep sure), I even deactivated the routers and pcs fire walls to make sure that this is not the problem. (searching for the problem got me no useful results)

    Also, after the server disappeared from the list i think you should be still able to connect "manually" by typing connect in the console.

    Anybody knows what could be wrong?
  • PhYzorPhYzor Join Date: 2003-10-26 Member: 22005Members, Constellation, Reinforced - Shadow
    NS2 is not optimise !

    just wait
  • Horseless HeadmanHorseless Headman Join Date: 2011-01-07 Member: 76594Members
    <!--quoteo(post=1868238:date=Aug 10 2011, 11:08 PM:name=AssassinY2K)--><div class='quotetop'>QUOTE (AssassinY2K @ Aug 10 2011, 11:08 PM) <a href="index.php?act=findpost&pid=1868238"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->When I joined, tick rate was a stable 30, but when I filled the 12 slots with bots, it went down to 20~24 tick rate, thats with about 20 sentry guns and several buildings<!--QuoteEnd--></div><!--QuoteEEnd-->

    I would sacrifice a small child to get 20-24 tick rate under those circumstances... seriously. I'm running an HP ML110 G5 and once my server starts filling up, 5-8 tick rate.

    Even the HBz and Frelge servers don't maintain a steady 30 tick rate in the heat of the moment.
  • AssassinY2KAssassinY2K Join Date: 2002-11-09 Member: 7931Members, Reinforced - Supporter
    I am upgrading to 4 x Six-Core AMD Opteron (24 cores total), 4 x 500gb HDD in raid 0+1 to form a redundant 1GB HDD and 64GB ram
    Lets see what happens....

    Just to confirm, what ports on a dedicated server must be opened to the public? <b>27015 </b>for steam/hlds and <b>27016 </b>for ns2 server on UDP ?
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1868403:date=Aug 11 2011, 02:35 PM:name=AssassinY2K)--><div class='quotetop'>QUOTE (AssassinY2K @ Aug 11 2011, 02:35 PM) <a href="index.php?act=findpost&pid=1868403"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I am upgrading to 4 x Six-Core AMD Opteron (24 cores total), 4 x 500gb HDD in raid 0+1 to form a redundant 1GB HDD and 64GB ram
    Lets see what happens....

    Just to confirm, what ports on a dedicated server must be opened to the public? <b>27015 </b>for steam/hlds and <b>27016 </b>for ns2 server on UDP ?<!--QuoteEnd--></div><!--QuoteEEnd-->

    27015 is the connect port
    27016 is the query port

    Both are UDP only.
  • dePARAdePARA Join Date: 2011-04-29 Member: 96321Members, Squad Five Blue
    <!--quoteo(post=1868242:date=Aug 10 2011, 11:22 PM:name=AssassinY2K)--><div class='quotetop'>QUOTE (AssassinY2K @ Aug 10 2011, 11:22 PM) <a href="index.php?act=findpost&pid=1868242"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Ns2 server.exe only uses 1 core...<!--QuoteEnd--></div><!--QuoteEEnd-->

    So u say, Server.exe use 1 core. Thats right btw. and tell us ur going to upgrade to 24 cores ?

    What should happen in your opinion ?
    I tell you: 23 cores do nothing. The server.exe need 500mb ram. So you have 63gb left.
  • AssassinY2KAssassinY2K Join Date: 2002-11-09 Member: 7931Members, Reinforced - Supporter
    edited August 2011
    yes I did say 1 core and I understand NS2 can only utilize 1 of the cores, I'm just saying the server I hope to utilise just happens to have 24 cores on it, 1 of which I hope to dedicate to an NS2 server.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo(post=1868411:date=Aug 11 2011, 09:38 PM:name=devicenull)--><div class='quotetop'>QUOTE (devicenull @ Aug 11 2011, 09:38 PM) <a href="index.php?act=findpost&pid=1868411"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->27015 is the connect port
    27016 is the query port

    Both are UDP only.<!--QuoteEnd--></div><!--QuoteEEnd-->
    27016 also provides Steamworks, which I believe Spark currently does via UDP, but is also available via TCP, so if TCP & UDP is possible you might want to do that.
  • Racer1Racer1 Join Date: 2002-11-22 Member: 9615Members
    A similar problem existed near the very beginning of NS2 alpha development. There was 100% cpu usage with 0 players. That was fixed after a few releases. I suspect the same will happen here, now that it has been brought up.
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    <!--quoteo(post=1868403:date=Aug 11 2011, 11:35 AM:name=AssassinY2K)--><div class='quotetop'>QUOTE (AssassinY2K @ Aug 11 2011, 11:35 AM) <a href="index.php?act=findpost&pid=1868403"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I am upgrading to 4 x Six-Core AMD Opteron (24 cores total), 4 x 500gb HDD in raid 0+1 to form a redundant 1GB HDD and 64GB ram
    Lets see what happens....<!--QuoteEnd--></div><!--QuoteEEnd-->

    Since, right now the single-core speed is the biggest determining factor, I question whether you'll see any improvement doing this. That's why the guys running servers on home gamer PCs (Win7, i5/i7) have better quality servers than ones doing it on dedicated server systems.

    Also, unless you plan on hosting a lot of other game/VoIP/servers on this system (or you're running this for free), this might be a big waste of money.
  • RebellionEliteRebellionElite Join Date: 2011-07-27 Member: 112530Members
    Cause traditional dedicated servers have slower processors with lower clock speeds then the majority of home users. There is nothing different about a Xeon in comparison to an i7, same architecture. Just artificially imposed limitations. Opterons are the exception as they have native 8 Core and 12 Core CPU's now. But still similar architecturally to the Phenom II's.

    So if my i7 970 Hexacore is overclocked to 4.2 Ghz, I am going to trounce a 2.4 Ghz Xeon without question.
  • AssassinY2KAssassinY2K Join Date: 2002-11-09 Member: 7931Members, Reinforced - Supporter
    <!--quoteo(post=1868628:date=Aug 12 2011, 07:51 PM:name=RebellionElite)--><div class='quotetop'>QUOTE (RebellionElite @ Aug 12 2011, 07:51 PM) <a href="index.php?act=findpost&pid=1868628"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Cause traditional dedicated servers have slower processors with lower clock speeds then the majority of home users. There is nothing different about a Xeon in comparison to an i7, same architecture. Just artificially imposed limitations. Opterons are the exception as they have native 8 Core and 12 Core CPU's now. But still similar architecturally to the Phenom II's.

    So if my i7 970 Hexacore is overclocked to 4.2 Ghz, I am going to trounce a 2.4 Ghz Xeon without question.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Early tests on this system indicate the same problem, luckily it was a work server so I didn't pay the £8000 server cost :)

    I won't be attempting another setup until I can change the port and run a dedicated server on a dedicated server :)
  • maessemaesse Join Date: 2010-04-08 Member: 71213Members
    I'd guess that the server is doing busy-wait when players are connected. This means that when there's leftover cpu-time, the server will sit in a loop ("are we there yet?" x1000000) as opposed to telling the OS "I'm going to take a nap for at least 5 milliseconds". It's not necessarily a bad thing because a ton of computers have trouble with sleep precision (eg you tell the OS to sleep for 3ms, but then it ends up sleeping 10ms). Most games that have v-sync off will actually use a full cpu core because of this.

    tl;dr: sleeping is (usually) imprecise, using a full core gives better timing.
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1868420:date=Aug 11 2011, 04:24 PM:name=Racer1)--><div class='quotetop'>QUOTE (Racer1 @ Aug 11 2011, 04:24 PM) <a href="index.php?act=findpost&pid=1868420"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->A similar problem existed near the very beginning of NS2 alpha development. There was 100% cpu usage with 0 players. That was fixed after a few releases. I suspect the same will happen here, now that it has been brought up.<!--QuoteEnd--></div><!--QuoteEEnd-->

    The fix was to have the server essentially sleep when there's noone connected. The server using 100% cpu when there's any players connected is a "feature", not a bug. I doubt this is really an easy thing to fix, and it's probably going to wait until the engine gets some more/different optimizations.
  • juicejuice Join Date: 2003-01-28 Member: 12886Members, Constellation
    Recently there was an <a href="http://www.tomshardware.com/reviews/radeon-geforce-stutter-crossfire,2995.html" target="_blank">article at Tom's</a> regarding "Micro-stuttering" in games, and it is clearly relevant to the NS2 experience.

    My question is, can server ticks be affected in a similar way, with micro-tick-stuttering? And if so, is there a way to track it? I imagine CPU usage 100% would correspond to a server micro-stutter.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Are we talking about the micro-stutters on the client-side? I believe that is the same issue that has been plaguing the game since it's first release, the Lua garbage-collector. It's been fine-tuned in such a way that the stutters are less noticeable, but they are definitely still there, and will remain there until the Lua bit gets a major overhaul.
  • KalabalanaKalabalana Join Date: 2003-11-14 Member: 22859Members
    I'm guessing the math doesn't allow for enough wiggle room in the netcode to prevent bottlenecks caused by waiting for server ticks/client updates.

    There are bottlenecks, hopefully they will be found and addressed soon.
Sign In or Register to comment.