Another Cpu Optimization Problem

rofishrofish Join Date: 2003-05-30 Member: 16872Members
<div class="IPBDescription">30% CPU for one user?</div> I'd like to run a NS server but the CPU is way to high. Although 30% for one user seems strange, the problem is that this is a nice server. 3.2 GHz P4, 2.0 GB RAM, and yet when I test the server out, I'm getting 30% for when I'm just on. By comparision, I'm running a CS:S server on the same server as well and it tops 40% at peak times. I know there are a lot of solutions, but most of them involve kernel stuff that I don't have access to. Plus I'd like to keep it 2.4 for stability's sake.

I'm using nothing but an install using Vadakill's NS beta 5 instructions. Is there anyway I can optimize this without a kernel hack?

Linux starmen 2.4.28-grsec #1 SMP Mon Jan 10 09:58:21 EST 2005 i686 GNU/Linux

Comments

  • BorisBoris Join Date: 2002-12-30 Member: 11636Members
    edited February 2005
    The quickest, "dirtiest" optimization is....

    hate to say it....

    switch to Winblows <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad-fix.gif' border='0' style='vertical-align:middle' alt='sad-fix.gif' /><!--endemo-->

    I had to do it because I was just unable to get the server to run properly. The CPU was off the charts! What was 70% CPU in Linux is more like 8%~10% CPU in Windows.

    Until the steam dedicated server developers do something about this, you'll have to use Windows.

    ...maybe Microsoft has something to do with this...maybe some bribing perhaps!?

    Who knows, but it sucks!

    I run Windows 2003 Server for my server listed in my signature.

    The only person active on trying to support the Linux servers is Vadakill, so look for his posts/comments.
  • VadakillVadakill The Almighty BSO Join Date: 2002-04-02 Member: 373Members, NS1 Playtester
    edited February 2005
    <!--QuoteBegin-rofish+Feb 21 2005, 08:32 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (rofish @ Feb 21 2005, 08:32 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I'd like to run a NS server but the CPU is way to high. Although 30% for one user seems strange, the problem is that this is a nice server. 3.2 GHz P4, 2.0 GB RAM, and yet when I test the server out, I'm getting 30% for when I'm just on. By comparision, I'm running a CS:S server on the same server as well and it tops 40% at peak times. I know there are a lot of solutions, but most of them involve kernel stuff that I don't have access to. Plus I'd like to keep it 2.4 for stability's sake.

    I'm using nothing but an install using Vadakill's NS beta 5 instructions. Is there anyway I can optimize this without a kernel hack?

    Linux starmen 2.4.28-grsec #1 SMP Mon Jan 10 09:58:21 EST 2005 i686 GNU/Linux <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->


    I'm not sure what distro you are using but the 2.4 kernel's Hz setting can be adjusted as well, same principle applies. As a matter of fact, Linux distros figured out that they could produce a more responsive desktop environment by bumping up the kernel Hz back in the 2.4 kernels; Redhat started doing it with RH8 many other distros did as well. It's that extra "real-time" Hz setting that is great for desktops but destroys servers with massive overhead. Also, as a side note, the 2.6.9+ kernels are considered very stable.

    I don't understand how you don't have access to the kernel stuff. "2.4.28-grsec" sounds like a kernel patch or gentoo build, in which case you most definately should have access to the kernel source. Is this server rented or borrowed?

    Yes there are ways to set the Hz setting on the fly with no hack if you have a preemptable kernel, debian is one of those distros with this capability compiled in by default.
  • rofishrofish Join Date: 2003-05-30 Member: 16872Members
    edited February 2005
    What I mean by not having access to the kernel stuff is that I just run the CS:S (and hopefully) NS server. I do not have root access and the server administrator prefers 2.4 and getting her to give me a kernel hack is near impossible (and for good reasons such as security). Updating to 2.6 is just out of the question.

    We cannot switch to Windows as we are poor and don't want to pay extra for something inferior (IMO), and we are just using the Valve games as something to do with all the idle CPU time.

    We're running Debian. I think it's Debian Sarge if that means anything. Do you know where the Hz info would be? What do you think is a good number for a server whose primary function is a webserver (Apache, PHP, MySQL), and a NS server only on the side?
  • GiGaBiTeGiGaBiTe Join Date: 2003-10-07 Member: 21489Members
    the only advice i could give, is to use fedora core 3 instead of debian. it seems to work with hlds_l correctly as soon as its installed. thats what i use, all the other linux distros that i have worked with have issues with hlds and metamod. fedora core 3 seems to work best.

    but thats only if you can switch linux distrobutions.
  • tigertiger Join Date: 2005-02-26 Member: 42536Members
    Constant 99% load at 20 players, ns_eclipse.
    P4 2.4C GHz 875P chipset, Mandrake Linux 10.1


    Less than 10% load at 24 players, ns_eclipse
    Similar hardware, except chipset is 865, Windows 2003 Standard



    -_-
  • GiGaBiTeGiGaBiTe Join Date: 2003-10-07 Member: 21489Members
    mandrake is possibly one of the buggiest linux distros ever. i didnt try 10.1, but i had 10.0 and it would crash every chance it had.
  • tigertiger Join Date: 2005-02-26 Member: 42536Members
    <!--QuoteBegin-GiGaBiTe+Feb 26 2005, 06:58 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (GiGaBiTe @ Feb 26 2005, 06:58 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> mandrake is possibly one of the buggiest linux distros ever. i didnt try 10.1, but i had 10.0 and it would crash every chance it had. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    i don't have the time to go deal with gentoo etc. i just want things to be up fast. by the way i compiled from scratch gentoo 2.4 kernel for test. 4 players with 50% load.
  • BorisBoris Join Date: 2002-12-30 Member: 11636Members
    <!--QuoteBegin-tiger+Feb 26 2005, 07:45 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (tiger @ Feb 26 2005, 07:45 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> i don't have the time to go deal with gentoo etc. i just want things to be up fast. by the way i compiled from scratch gentoo 2.4 kernel for test. 4 players with 50% load. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I really hate stressing this point, as it goes against everything I believe but...

    Judging by your "I just want things to be up fast" comment, you want this server up and running ASAP, with least amount of hassles.

    Answer: You HAVE to switch to Windows! Unless you have a 10GHZ Processor...which I highly doubt!

    Sorry to any people working on optimizing Linux, but it's just too much work and people want servers now! They'll have to use Windows until Valve does something about this Linux mess!
  • GiGaBiTeGiGaBiTe Join Date: 2003-10-07 Member: 21489Members
    fedora core 3 stock (no kernel modifications) works great right after its installed. no recompiling the kernel is necessary. and if you cant get windows legally, its the best option.
  • tigertiger Join Date: 2005-02-26 Member: 42536Members
    I just installed Windows Server 2003 on mine. co_faceoff with 14 players is having 0% load!

    P4 2.4C GHz 1GB RAM DDR400
  • VadakillVadakill The Almighty BSO Join Date: 2002-04-02 Member: 373Members, NS1 Playtester
    edited February 2005
    Listen, I don't want to turn this into a Windows vs Linux or even a Distro vs Distro thread , it's been done 1,000 times before. The kernel compile guide is for those people who want to maximize their linux systems to be equal performance to a Windows system. It's pretty easy, but not "install it and forget it" easy. I'll admit, the first time I compiled a kernel it scared the hell out of me. Really, it's for those people who have the time and ambition to want to learn more, even if things go badly.

    I don't know what I can do to make it easier short of creating a kernel RPM (which I have no idea how to do).
  • BorisBoris Join Date: 2002-12-30 Member: 11636Members
    Vadakill, how much testing has been done and what are the results? I will still be interested in trying this out sometime, but I have no time to do it these days.

    Hopefully in not too long, I will be able to dual boot one of my older machines and put a 10-12 person game up and do some testing between Windows and Linux.
  • VadakillVadakill The Almighty BSO Join Date: 2002-04-02 Member: 373Members, NS1 Playtester
    edited February 2005
    ***edit***

    One thing I wanted to try was *lowering* the sys_ticrate. I notice many, many admins raise this in order to lower pings with the side effect of also raising the CPU overhead. Has anyone tried lowering it to 66 or 33 instead of the default 100? I noticed that on the HL2DM the default ticrate was 66, and the default for a CS:S server was 33.

    EDIT: Tonight we did a PT on a variety of maps with about 8 people and the CPU never went over 10% We did try to crash the server by placing a TON of turrets, OCs and sieges not to mention a bunch of other structures; even then the CPU hovered between 27-35%
  • BorisBoris Join Date: 2002-12-30 Member: 11636Members
    The specs on that server?
  • tigertiger Join Date: 2005-02-26 Member: 42536Members
    Umm interesting stuff to share on Windows. Because after trying Windows, I am switching back to Linux.


    Firstly, yes Windows load is way lower. However you cannot multi-task with it despite HT is turned on. Or you will see the same result as Linux. Linux actually does better when dealing with Multi-tasking (Gentoo Distro with Custom Optimised 2.6 Kernel)

    Secondly, Windows is more unstable as it tends to crash easier. Each time when you log on the Windows (Remote Desktop) it sometimes cause a spike lag in the Game Server.

    Thirdly, according to a friend that is certified Microsoft Certified Server Admin, he told me the SMP/HT CPU Load Metering on Windows is not very accurate. And that's why we may see very low load with single task.


    P.S.: Just to share a bit....
  • VadakillVadakill The Almighty BSO Join Date: 2002-04-02 Member: 373Members, NS1 Playtester
    <!--QuoteBegin-Boris+Mar 1 2005, 01:11 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Boris @ Mar 1 2005, 01:11 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> The specs on that server? <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    2800Mhz Pentium 4, HT is enabled.
  • havenhaven Join Date: 2002-11-15 Member: 8767Members
    edited March 2005
    The specs for our current server which runs fine with low CPU usage - so low that we are able to run a 22 player NS and a 12 player CS:S on the same CPU.

    System: (serenity.thehavennet.org.uk:27015)

    P4 3.0 1MB cache (the cache is all important for a game server)
    1 Gig Ram
    100mbit connection
    Gentoo default Kernel 2.4.28 (ironically appears to work better than a 2.6 kernel but I cant explain why).

    Setup
    nice -n 15 hlds_run -game ns +map ns_hera +maxplayers 22 -pingboost 3 +sv_maxupdaterate 200 -dll addons/metamod/dlls/metamod_i386.so

    We are running the latest NS 3.01 with amx mod-x and metamod-p rather than metamod, we are also running cheating death in optional mode. We've around 20 plugins loaded and when the server is full (20-22 player) we see around 60% (variable between 40-70%) cpu usage.

    Fortunately Counter Strike Source uses very little CPU so running that alongside is perfectly viable.

    The 30% CPU usage the original poster was mentioning is certainly not the norm for ourselves although systems are complex things and he is best using the ps and top tools to track down the resource hog.

    I believe that windows still has the upper hand in CPU usage but that the situation is not nearly as unbalanced as it was six months ago. A linux server is certainly still viable although you will need top end hardware to run a large server.
  • VadakillVadakill The Almighty BSO Join Date: 2002-04-02 Member: 373Members, NS1 Playtester
    edited March 2005
    Many 2.4 kernels have a Hz setting of 100 or 512 while the default Hz of nearly every 2.6 kernel distro is 1000. This could explain why the 2.4 seems better.

    -pingboost 3 will use up as many "left over" cpu cycles as it can. Use -pingboost 1 for more reasonable CPU usage.

    Counter Strike source has a default sys_ticrate of 33, while HL1 mod's default is 100. Lower ticrate = less CPU usage.
  • cracker_jackmaccracker_jackmac Join Date: 2002-11-04 Member: 6891Members, Constellation, Reinforced - Shadow
    edited March 2005
    <!--QuoteBegin-Vadakill+Mar 19 2005, 03:11 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Vadakill @ Mar 19 2005, 03:11 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Many 2.4 kernels have a Hz setting of 100 or 512 while the default Hz of nearly every 2.6 kernel distro is 1000.  This could explain why the 2.4 seems better.

    <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    2.4 kernels also have a MUCH different VM system which can play a large part in CPU utilization. Prodigy noted that 2.4.9 kernel ran tons better over 2.4.20 (?). But this is because in 2.4.10 the lkdevs ripped out the VM system and re-wrote it to regain stability. No, you don't swap out HLDS, but considering it for swap or even handling memory stacks themselves can become CPU intense if not handled properly.

    Place a 2.6 kernel with HZ=100 along side a 2.4 kernel with HZ=100 and you will see that 2.6 kernels have comparable CPU stats, but are faster and more stable. The only thing I might want to mention that is pre-emption, while 'god-like' performance gains in 2.4 kernels, cause stability issues in 2.6, especially with hyper-threading. If you have 2.6 and a proc that supports HT, disable pre-emption, enable ACPI-IO, and enable Special conditions for HT systems (just under SMP).

    HZ DOES make a difference, but should be noted, that isn't the only reason as well.

    Just writting this to re-enforce vada <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile-fix.gif' border='0' style='vertical-align:middle' alt='smile-fix.gif' /><!--endemo-->

    <a href='http://www-106.ibm.com/developerworks/linux/library/l-web26/' target='_blank'>http://www-106.ibm.com/developerworks/linux/library/l-web26/</a>

    Just to so how well 2.6 scales over 2.4 kernels.
  • strikeforcestrikeforce Join Date: 2003-11-11 Member: 22523Members, Constellation
    <!--QuoteBegin-Vadakill+Mar 1 2005, 07:08 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Vadakill @ Mar 1 2005, 07:08 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->***edit***

    One thing I wanted to try was *lowering* the sys_ticrate.  I notice many, many admins raise this in order to lower pings with the side effect of also raising the CPU overhead.  Has anyone tried lowering it to 66 or 33 instead of the default 100?  I noticed that on the HL2DM the default ticrate was 66, and the default for a CS:S server was 33.

    EDIT: Tonight we did a PT on a variety of maps with about 8 people and the CPU never went over 10%  We did try to crash the server by placing a TON of turrets, OCs and sieges not to mention a bunch of other structures; even then the CPU hovered between 27-35%<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    What ticrate did you try then. I've had to recompile a few kernels. I might look at creating a rpm for Fedora since its what I run at home just for gaming. At the moment I'm trying to tweak my graphics card cause I want to play NS on linux running cedega.
  • VadakillVadakill The Almighty BSO Join Date: 2002-04-02 Member: 373Members, NS1 Playtester
    <!--QuoteBegin-strikeforce+Apr 15 2005, 03:14 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (strikeforce @ Apr 15 2005, 03:14 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> What ticrate did you try then. I've had to recompile a few kernels. I might look at creating a rpm for Fedora since its what I run at home just for gaming. At the moment I'm trying to tweak my graphics card cause I want to play NS on linux running cedega. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I didn't try any ticrate other then the default, I'm of the camp that if it ain't broke don't fix it. I was suggesting to people to NOT set their ticrate to 500 or some other rediculous rate and instead try lowering it to see if it helps out their CPU usage. I have not tested this on my system at all, I was hoping someone other then me would try it and get back to us with the results.

    I don't think that lowering the Hz rating for a Desktop setup would be a good idea, I suggest lowering the Hz setting for machines that are dedicated servers only. Lowering the Hz rate on the desktop might make it feel more "sluggish" in the GUI.
  • BIGPhilBIGPhil Join Date: 2005-04-18 Member: 48832Members
    edited April 2005
    I've reduced sys_ticrate to 50, and the cpu load came down by roughly 5-10% (possibly a little under). However, I would much rather have it up at the default as whether or not it's just me, I do feel something is a little off when playing on it.

    I've been trying to run 2 servers (both 16 man) on an AMD XP3000 with 1 Gig of RAM but the cpu load when one of the servers is full is between 40% and 60% which is too much (60+60=unhappy server). The system OS is Linux (something I know very little about). Is there anything I should do that I haven't done as running only 1 server on this box seems a little stupid when you could probably manage 4 normal CS servers?

    What will be the effects of changing the HZ setting?
  • DaJMastaDaJMasta Join Date: 2005-01-10 Member: 34750Members, Constellation
    just from what I've read here, decreasing the Hz setting will increase the delay time between kernel updates, decreasing unnecissairy fps on servers. So by decreasing the Hz setting, your technically limiting the amount of power the server is allowed to use, which scales back the extra ticks quite a bit, especially when there is few users.

    Give the server less head room, and it will take up less overall power, the trick is to give it enough headroom to perform properly and little enough for maximum optimization.
  • GiGaBiTeGiGaBiTe Join Date: 2003-10-07 Member: 21489Members
    sys_tickrate of 300 works fine on my linux box. with the cpu usage idiling around 5-10% 10 player carnage brings it up to about 35-55%
  • DaJMastaDaJMasta Join Date: 2005-01-10 Member: 34750Members, Constellation
    may i ask what cpu u have and how much ram?

    I think im going to be starting a linux server with some extra cash this summer.
  • strikeforcestrikeforce Join Date: 2003-11-11 Member: 22523Members, Constellation
    I've created a few rpm's I'm going to need some NS server admins that do have root access to test them. I currently don't have root access to my server since I set it up but it runs multiple games from an isp.

    I would like some people to test it they are in RPM format. I don't have a fast upload capability so I'll only want a few people testing it if its ok I try and get it hosted somewhere and post the link.
Sign In or Register to comment.