Another Cpu Optimization Problem
rofish
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
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
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.
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.
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?
but thats only if you can switch linux distrobutions.
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
-_-
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.
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!
P4 2.4C GHz 1GB RAM DDR400
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).
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.
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%
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....
2800Mhz Pentium 4, HT is enabled.
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.
-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.
<!--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.
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.
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.
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?
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.
I think im going to be starting a linux server with some extra cash this summer.
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.