Server idle CPU usage

devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
Why does the server use around 80% of a CPU core when it's idle? Is anyone else seeing this? I've never seen a server use so much CPU when idle.

<img src="http://dl.dropbox.com/u/2078961/ns2_idle.png" border="0" class="linked-image" />

Comments

  • KuBaNKuBaN Join Date: 2002-11-16 Member: 8979Members, Constellation
    Are you looking for the "Because it's an unfinished product," answer, or a more detailed explanation?
  • ThaldarinThaldarin Alonzi&#33; Join Date: 2003-07-15 Member: 18173Members, Constellation
    <!--quoteo(post=1839487:date=Apr 1 2011, 02:13 AM:name=KuBaN)--><div class='quotetop'>QUOTE (KuBaN @ Apr 1 2011, 02:13 AM) <a href="index.php?act=findpost&pid=1839487"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Are you looking for the "Because it's an unfinished product,"<!--QuoteEnd--></div><!--QuoteEEnd-->

    If he wanted that answer, he wouldn't be running a server.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    I do not run a server myself, so I cannot make a detailed observation, but I have given a wildly speculative cause in your last thread in response to endar who ran into the exact same thing:
    <!--QuoteBegin-'an intelligent chap'+--><div class='quotetop'>QUOTE ('an intelligent chap')</div><div class='quotemain'><!--QuoteEBegin-->Another interesting fact is that the server tick-rate apparently goes to 1 when there are no more players. I'm not sure whether this is new since the latest build, or has been around for longer, but it's the first time I've actually noticed this (thanks to Plasma's dev-tracker). If this is indeed a new feature, then a problem in it's implementation might explain endar's observations.<!--QuoteEnd--></div><!--QuoteEEnd-->
    What you could try is open up the task-manager, and have a look at the resource-monitor, see what the Server.exe-process is up to exactly.
  • MaxMax Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
    The server will use a lot of CPU resources regardless of how much work it's doing, because the main loop is a busy loop. This loop which consumes CPU cycles until it's ready to do some actual work (which it does 30 times per second based on the tick rate). This will be addressed in the future.
  • NurEinMenschNurEinMensch Join Date: 2003-02-26 Member: 14056Members, Constellation
  • mobettamobetta Join Date: 2010-07-23 Member: 72693Banned
    edited April 2011
    Thats going to be a big deal when thos gsp start vming the poop out of there boxes.
  • endarendar Join Date: 2010-07-27 Member: 73256Members, Squad Five Blue
    <!--quoteo(post=1839475:date=Apr 1 2011, 11:19 AM:name=devicenull)--><div class='quotetop'>QUOTE (devicenull @ Apr 1 2011, 11:19 AM) <a href="index.php?act=findpost&pid=1839475"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Why does the server use around 80% of a CPU core when it's idle? Is anyone else seeing this? I've never seen a server use so much CPU when idle.

    <img src="http://dl.dropbox.com/u/2078961/ns2_idle.png" border="0" class="linked-image" /><!--QuoteEnd--></div><!--QuoteEEnd-->
    I noticed it first in build 168, heres a <a href="http://unknownworlds.com/ns2/forums/index.php?s=&showtopic=112988&view=findpost&p=1837528" target="_blank">link</a> (to your thread which I attempted to hijack).


    <!--quoteo(post=1839497:date=Apr 1 2011, 02:16 PM:name=Max)--><div class='quotetop'>QUOTE (Max @ Apr 1 2011, 02:16 PM) <a href="index.php?act=findpost&pid=1839497"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The server will use a lot of CPU resources regardless of how much work it's doing, because the main loop is a busy loop. This loop which consumes CPU cycles until it's ready to do some actual work (which it does 30 times per second based on the tick rate). This will be addressed in the future.<!--QuoteEnd--></div><!--QuoteEEnd-->

    What we are describing is slightly different, or is new behavior from 168 onwards. Was there a busy loop in 167? If so, it wasn't working. In 167 and before, the server would sit at about 1-5% (single core) while empty, and uniformly ramp up to 100% when it hit it's "limit". What it does now, is starts at 100%, and as soon as a player joins, it will drop back to the 1-5%, and then continue to ramp up. I'm not going to repost it, just read what I posted before: <a href="http://unknownworlds.com/ns2/forums/index.php?s=&showtopic=112988&view=findpost&p=1837528" target="_blank">link</a>
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Just to elaborate what I ment by an improper implementation, perhaps a player-checker is constantly cycling through a while-loop, this would cause a maximum single threaded CPU-load. It's a bit daft to think Max would do something that silly, but it is a possible explanation. It would also explain why CPU-usage goes down the moment a player enters (as it leaves the while-loop and enters a loop that is maxed by 30FPS, possibly via a Sleep which will not incur any CPU-cycles).
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1839523:date=Apr 1 2011, 08:16 AM:name=endar)--><div class='quotetop'>QUOTE (endar @ Apr 1 2011, 08:16 AM) <a href="index.php?act=findpost&pid=1839523"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I noticed it first in build 168, heres a <a href="http://unknownworlds.com/ns2/forums/index.php?s=&showtopic=112988&view=findpost&p=1837528" target="_blank">link</a> (to your thread which I attempted to hijack).




    What we are describing is slightly different, or is new behavior from 168 onwards. Was there a busy loop in 167? If so, it wasn't working. In 167 and before, the server would sit at about 1-5% (single core) while empty, and uniformly ramp up to 100% when it hit it's "limit". What it does now, is starts at 100%, and as soon as a player joins, it will drop back to the 1-5%, and then continue to ramp up. I'm not going to repost it, just read what I posted before: <a href="http://unknownworlds.com/ns2/forums/index.php?s=&showtopic=112988&view=findpost&p=1837528" target="_blank">link</a><!--QuoteEnd--></div><!--QuoteEEnd-->

    Indeed, the idle CPU usage has gone up significantly since older releases.. For example let's take build 162: <img src="http://dl.dropbox.com/u/2078961/ns2.png" border="0" class="linked-image" />
    As long as this is something that's a known issue, that's fine with me. I just wanted to make sure someone was aware of it.
  • AdamaAdama Join Date: 2010-12-21 Member: 75826Members
    Just a note to say that I also experiance this - Occured since 168. At first I thought this was a major issue, but it doesn't seem to have had a major affect on performance.
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    <!--quoteo(post=1839521:date=Apr 1 2011, 05:04 AM:name=mobetta)--><div class='quotetop'>QUOTE (mobetta @ Apr 1 2011, 05:04 AM) <a href="index.php?act=findpost&pid=1839521"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Thats going to be a big deal when thos gsp start vming the poop out of there boxes.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Well, if it stays like this no one will be able to run any VM's on a box running NS2. It will all have to be dedicated if an idle server consumes 80% of CPU resources.
  • NurEinMenschNurEinMensch Join Date: 2003-02-26 Member: 14056Members, Constellation
    Uhm... it's pretty obvious that the servers won't idle at ~80% CPU usage when the game is released, so what's the point of that comment?
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    <!--quoteo(post=1839798:date=Apr 4 2011, 11:22 AM:name=NurEinMensch)--><div class='quotetop'>QUOTE (NurEinMensch @ Apr 4 2011, 11:22 AM) <a href="index.php?act=findpost&pid=1839798"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Uhm... it's pretty obvious that the servers won't idle at ~80% CPU usage when the game is released, so what's the point of that comment?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Fair enough, but even an idle of say 10% wouldn't be very good. I think my biggest concern is that idle CPU usage seems to be increasing with each patch rather than decreasing. This is also one of those issues that has little impact on the game itself (i.e. I could see UWE releasing NS2 v1.0 with some decent idle CPU usage so that they could get the game out sooner rather than later), but a much larger impact on server owners, namely it drives up the cost of hosting NS2 because you'd need to run a dedicated box rather than VM.
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1839834:date=Apr 4 2011, 04:49 PM:name=ScardyBob)--><div class='quotetop'>QUOTE (ScardyBob @ Apr 4 2011, 04:49 PM) <a href="index.php?act=findpost&pid=1839834"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Fair enough, but even an idle of say 10% wouldn't be very good. I think my biggest concern is that idle CPU usage seems to be increasing with each patch rather than decreasing. This is also one of those issues that has little impact on the game itself (i.e. I could see UWE releasing NS2 v1.0 with some decent idle CPU usage so that they could get the game out sooner rather than later), but a much larger impact on server owners, namely it drives up the cost of hosting NS2 because you'd need to run a dedicated box rather than VM.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Indeed, don't expect cheap servers for NS2 if the idle CPU usage remains at this level. An idle NS2 server now uses about as much CPU as a 24 slot TF2 server that's full.
Sign In or Register to comment.