Surefire Ways To Tune Your NS Server
MonsieurEvil
Join Date: 2002-01-22 Member: 4Members, Retired Developer, NS1 Playtester, Contributor
<div class="IPBDescription">Experienced Ops - add your tricks here</div> <b>Note:</b> This thread is extremely old, and was started when NS 1.0 came out, so keep that in mind.
-----------
Here are some additional sure-fire ways to reduce CPU usage (especially over time), and to help keep 'lag' lower:
The network usage is actually quite a bit less than CS due to better optimization, so your connection speeds are not the issue. It's still CPU processing the resource model, 100x extra entities, and other aspects that a CS server doesn't have to track. There are some things you can do though:
1. Do not run HLTV proxy or allow HLTV connections
2. Knock your player count down by 2 slots (maybe do this after step 3, waiting on results).
3. Shorten your mp_timelimit to be 15 minutes. This will ensure that there are not too many round resets before there is a map cycle. There are some bugs which cause certain entitites to linger after a round resets which only a map change will clear. This is part of the reason a 2 hour game will cause more and more bogging on the CPU.
4. With Win32 servers, tune your OS with this guide to minimize OS overhead: <a href='http://www.readyroom.org/perfgde_1.html' target='_blank'>Rreadyroom.org WinXP/2000 Tuning Guide </a>
We're working with Valve to get some clues on some of the processing bottlenecks (some of which are HL engine issues at their core - it was never designed to do this!), so we should have yet another server patch in some time.
-----------
Here are some additional sure-fire ways to reduce CPU usage (especially over time), and to help keep 'lag' lower:
The network usage is actually quite a bit less than CS due to better optimization, so your connection speeds are not the issue. It's still CPU processing the resource model, 100x extra entities, and other aspects that a CS server doesn't have to track. There are some things you can do though:
1. Do not run HLTV proxy or allow HLTV connections
2. Knock your player count down by 2 slots (maybe do this after step 3, waiting on results).
3. Shorten your mp_timelimit to be 15 minutes. This will ensure that there are not too many round resets before there is a map cycle. There are some bugs which cause certain entitites to linger after a round resets which only a map change will clear. This is part of the reason a 2 hour game will cause more and more bogging on the CPU.
4. With Win32 servers, tune your OS with this guide to minimize OS overhead: <a href='http://www.readyroom.org/perfgde_1.html' target='_blank'>Rreadyroom.org WinXP/2000 Tuning Guide </a>
We're working with Valve to get some clues on some of the processing bottlenecks (some of which are HL engine issues at their core - it was never designed to do this!), so we should have yet another server patch in some time.
Comments
Just doing this instead of replying 30 times as I update my post. (Mainly for my good maps/bad maps list.)
Default minrate and maxrate are both set to zero. I've got <b>plenty</b> of bandwidth, though I noticed that when I set sv_maxrate to 8500, the pings all dropped about 20 across the board. This probably varies from server to server, but it is definately something to check out. Perhaps less dataflow gives the server less to work on? I also noticed that if you drop it too low, the pings will skyrocket, as expected. You just have to find that sweet spot for your maxplayers and computer setup.
I've heard a lot of things about certain maps being tremendously buggy and tearing through CPU power, drastically raising pings. Anyone have a list of such maps? What have you noticed?
Edit:
I'll keep a list of both low ping and high ping maps as I figure out which they are:
(My server holds 12 until I can figure out the laggy maps, take them off the rotation, and up the count)
<b>GOOD</b> (Lower CPU Usage Maps)
ns_eclipse (personally unverified)
ns_tanith (14 plyr, 90% CPU usage, pings avg 130, a few sub-100)
ns_nancy (full server, all players sub-100, CPU @ 58%)
ns_nothing (full, one ping steady at 55 <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' valign='absmiddle' alt='biggrin.gif'><!--endemo--> so no overall lag, CPU @ 85%)
<b>BAD</b> (Higher CPU Usage Maps)
ns_hera (12 players, 95% usage, pings ~150) Pings are now creeping upwards, ~175 <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo--> This map bites
ns_bast (12 players, 95% usage, pings ~190)
-------------------------------------
Okay, here are some settings that I just tweaked a bit. They lowered the pings about 30-40ms. <!--emo&:0--><img src='http://www.unknownworlds.com/forums/html/emoticons/wow.gif' border='0' valign='absmiddle' alt='wow.gif'><!--endemo--> From 215ish av to 170.
<!--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-->mp_networkmeterrate 7500
sv_maxupdaterate 100
sv_minrate 0
sv_maxrate 10000
mp_lowlag 1<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
mp_lowlag is a CS setting, I thought. I set it to 1, the pings go down a bit. I set it to 0, the pings go up a bit. I tried back and forth few times and got the same results. Post your results here, I'd be interested in this being a fluke or not.
Network meter rate is set to 7500 from 100000. Pings seem more stable than previously. Again, this is the <b>only</b> thing on a 10mbps line. Bandwidth isn't making the difference, it is the CPU usage. Edit yet again: the mp_networkmeterrate makes a huge difference. All the pings are sub 200. Previously about half the pings were averaging 200. No one in the server is complaining of lag. The map is ns_hera, (see above), a high cpu usage map <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
I've heard a lot of things about certain maps being tremendously buggy and tearing through CPU power, drastically raising pings. Anyone have a list of such maps? What have you noticed?
Edit:
I'll keep a list of both low ping and high ping maps as I figure out which they are:
(My server holds 12 until I can figure out the laggy maps, take them off the rotation, and up the count)
<b>GOOD</b> (Lower CPU Usage Maps)
ns_eclipse
ns_tanith
ns_nancy (full server, all players sub-100, CPU @ 58%)
ns_nothing (full, one ping steady at 55 <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' valign='absmiddle' alt='biggrin.gif'><!--endemo--> so no overall lag, CPU @ 85%)
<b>BAD</b> (Higher CPU Usage Maps)
ns_hera (12 players, 95% usage, pings ~150) Pings are now creeping upwards, ~175 <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo--> This map bites
-------------------------------------
Okay, here are some settings that I just tweaked a bit. They lowered the pings about 30-40ms. <!--emo&:0--><img src='http://www.unknownworlds.com/forums/html/emoticons/wow.gif' border='0' valign='absmiddle' alt='wow.gif'><!--endemo--> From 215ish av to 170.
<!--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-->mp_networkmeterrate 7500
sv_maxupdaterate 100
sv_minrate 0
sv_maxrate 10000
mp_lowlag 1<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
mp_lowlag is a CS setting, I thought. I set it to 1, the pings go down a bit. I set it to 0, the pings go up a bit. I tried back and forth few times and got the same results. Post your results here, I'd be interested in this being a fluke or not.
Network meter rate is set to 7500 from 100000. Pings seem more stable than previously. Again, this is the <b>only</b> thing on a 10mbps line. Bandwidth isn't making the difference, it is the CPU usage. Edit yet again: the mp_networkmeterrate makes a huge difference. All the pings are sub 200. Previously about half the pings were averaging 200. No one in the server is complaining of lag. The map is ns_hera, (see above), a high cpu usage map <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo--><!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
thanks for the tips, using them in my server to see if it does help out. <!--emo&::sentry::--><img src='http://www.unknownworlds.com/forums/html/emoticons/turret.gif' border='0' valign='absmiddle' alt='turret.gif'><!--endemo-->
The built in HLDS pingbooster is activated by the -pingbooster <X> command line parameter. (X is between 1 and 3, experiment for which works best).
Or you can use 3rd party soloutions.
<a href='http://www.udpsoft.com/booster/' target='_blank'>UDP Softwares Pingbooster for Linux</a> or <a href='http://hullu.xtragaming.com/metamod/plugins.html#booster' target='_blank'>hullus Win-HL Booster for win32</a> (requires <a href='http://www.metamod.org' target='_blank'>MetaMod</a>)
Try as many of these options as you like, see which works best for you.
Edit:
Just played ns_nancy, CPU usage never got above 25% for the whole round.
Very odd.
Hosting a server from a cable modem?
Got my first server running decent with 14 people. I also use no max rate also as bandwith is not a problem. My server ranges between 50-150 ping on a full server, except on the evil maps listed above (bast and hera) where they slowly crept to about 400 right before the mapchange. The changes listed by Tweedle did help me wipe off about 50 ping average, so they do work. Next I am going to try the pingbooster thing as my Linux load is staying reasonably low.
My little hint for linux users: I found renice'ing the hlds process to about -10 cut alot of the ping off too with the cost of higher CPU load... so use this only if CPU load is not a problem. This would be the same as raising the HLDS thread priority to High in Windows machines.
Good luck, and keep the hints coming!
|TE|GoleX
Twilight Eclipse NS v1.01
i wonder if the particle systems are the source of the cpu usage problem.
i wonder if the particle systems are the source of the cpu usage problem.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
sounds like it <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
I've tried many different approaches to work around this (some of you may have joined one of my test servers where various entities blinked in and out of existence), but I haven't been able to get anything to work yet. I'm still working on it.
Now if I could just convince ATTBI to consistently provide me the full 384kbit/s upstream I pay for so my connection doesn't surge to 3000 ms latency when I'm only pushing 15-20K/s upstream from my server. <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
load avg was like 2.0 before and now it's stable near 1.0
current kernel used: 2.4.18rc4aa1
oh and
Load Averages 1.01 1.04 1.00 (server is full)
I've tried many different approaches to work around this (some of you may have joined one of my test servers where various entities blinked in and out of existence), but I haven't been able to get anything to work yet. I'm still working on it.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
Is this something you can eventually work around? Or is it an engine limitation that Valve will have to address?
i don' even hear the word " LAG"! <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo--> even on ns_hera ( great map btw )
Many 16 player servers I've found are hit bad by this, I think they are just trying to overwork their CPU without thinking about what the effect will be on the game and they ignore the fact that it DOES make a difference if their server will handle less players better.
The good servers are already starting to become obvious by the simple fact that they're full all the time.
PS: Keep up the good work admins, you make the entire experience enjoyable with your constant work at improving what is already going. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' valign='absmiddle' alt='biggrin.gif'><!--endemo-->
the lower the cpu the better because otherwise major companies won't sell servers within an affordable price and/or put up a few servers.
Thanks
Thanks<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
you need more ram. I have 1Gb and i have like 10mb free. i run a DS too but its all about the maps. I disabled the crappy maps ns_hera and ns_bast. Although i enjoy these maps, u can't enjoy them with 400ms pings. *sigh* oh well. until the next patch i guess.
That coupled with an mp_timelimit 30 works perfectly as well as votepercentneeded to .75
So far so good, ill keep you informed if I figure out anything...
-iggy
(Pointblank)
Many 16 player servers I've found are hit bad by this, I think they are just trying to overwork their CPU without thinking about what the effect will be on the game and they ignore the fact that it DOES make a difference if their server will handle less players better.
The good servers are already starting to become obvious by the simple fact that they're full all the time.
PS: Keep up the good work admins, you make the entire experience enjoyable with your constant work at improving what is already going. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' valign='absmiddle' alt='biggrin.gif'><!--endemo--><!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
I have 18 player server without ping or lag problems.. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
amd 2000 xp+ with 512mb linux server <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
Svencoop with monsters on the whole map doesn't even do this much
and other games................
but great mod, really enjoy it on maps that don't lag.
ns_nancy, ns_eclispe, and i think nothing runs great for me while playing and running server on same system.
I run a cs, sc server but i can't do that now. <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
Right now i'm running 10 players on hera with 50% utilization, which is manageable; but if I filled up to 16 players, than it would probably be nuts.
I rather like hera too.... <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' valign='absmiddle' alt='tounge.gif'><!--endemo--><!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
Hurrah, it's nice to hear that amongst all the complaints that its too laggy! For the record, I dislike the HL engine right now.
Nano now runs the latest AdminMOD (due to 1.02b patch) and its contributing about 10 to 20% more CPU loads and currently runs in the neighborhood of 60 to 65% on a full 16 player server.
As for the best kernel to run, nano runs on 2.4.19 now and its dropped the loads down about 5 to 10% more than its usual 80's and higher loads. With some tweaking I bet it could be lower, but only if Leon Hartwig of VALVe woudl get off his lazy butt and make HLDS linux native (Multi-Threading and SMP support) this would'nt be such a problem right away.
ill keep you informed as usual about nanos changes and things I come across.
-Theiggsta
(Pointblank)
If I can fix the problem, you'll see CS-like performance in NS.... :)