SRCDS Steam group


SRCDS High Cpu Usage Problem! Please Help
#1
Hi

I have 34 slot public css server, and using mani, sm, mm mods.

Problem is high cpu usage;

example 1; 23 player in server cpu 76.00
Code:
CPU   In    Out   Uptime  Users   FPS    Players
76.00 132150.28 320044.59    1221    25  943.40      23
example 2; 32 player in server cpu 94.00 but only per round.. later minutes in the fall 75,74,65....
Code:
CPU   In    Out   Uptime  Users   FPS    Players
94.00 122750.63 340064.14    1224    25  845.60      32

server start command;
Code:
./srcds_run -game cstrike -ip xxx.xxx.xxx.xxx -port 27015 -maxplayers 34 -tickrate 100 +fps_max 1000 +map de_dust2 +servercfgfile server.cfg

Hardware;
Intel Xeon E5520 8 core cpu
8 GB DDR3 memory
500GB HDD
100mbit network


Please help me, why usage high cpu ? Sad
Reply
#2
Why are you running 30+ slots at 1kfps?

- Don't trust the cpu usage in stats. Disable it and save some CPU time (sv_stats 0)
- Don't run large slot counts with 1000fps. This is generally bad. Then again, anything over the tickrate just wastes CPU cycles.
http://leaf.dragonflybsd.org/~gary

“The two most common elements in the universe are hydrogen and stupidity.”








Reply
#3
monk is right (in most points). but the essential question is: do you have any real problems? the cpu usage is just a number (and it's quite random for srcds/hlds, also if you measure it in other ways e.g. using top. DO NOT LOOK AT THE CPU USAGE)
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#4
Hmm.. thans for reply,,

I try 66 tick + 500 fps or 600 fps.

And see cpu stats in top but with the same "stats" almost
Reply
#5
again: are there any actual problems? does the server lag? if so, are the fps stable or not (try measuring them with the fps meter and post the result here)?
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#6
Omg :\
http://www.fpsmeter.org/p,view;74781.html
30 players playing at this time
Reply
#7
Too much context switching.
http://leaf.dragonflybsd.org/~gary

“The two most common elements in the universe are hydrogen and stupidity.”








Reply
#8
what kernel do you run? give us the output of
Code:
uname -a
if you compiled it yourself, did you follow a specific tutorial? maybe you must compile the kernel with HZ=100 (NOT 1000) and dynamic ticks to reduce the (unnecessary) context switching.

do you have any plugins installed?

maybe you even need to lower the tickrate to 33.

PS: yeah, 1001 posts xD
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#9
Code:
Linux 2.6.34 #1 SMP PREEMPT Thu Jun 10 04:11:21 EEST 2010 i686 i686 i386 GNU/Linux

Disable Dynamic Ticks
Enable High Resolution Timer
Timer frequency 1000 HZ
User HZ 100 (param.h)

Installed plugins;

Valve plugin;
DAF Doss attack fix

Sourcemod plugin;
Bomb_Events
gem_halftime_teamswap
no_team_flash
noblock
rcon_lock
showdamage
Reply
#10
dynamic ticks will increase timer overhead because they will be called as needed instead of in active mode.

Try removing your plugins, too and run with a stock server to see if that fixes it.
http://leaf.dragonflybsd.org/~gary

“The two most common elements in the universe are hydrogen and stupidity.”








Reply
#11
first, amd64 (= x86_64) seems to be the better architecture for srcds. so you might want to switch to 64 bit.

then you might want to enable dynamic ticks (I guess, Monk has a typo in his sentence, of course dynamic ticks DEcrease the timer overhead, as unnecessary ticks are left out) and reduce the timer frequency to 100 Hz.

and yes, it might be a good idea to start with a plain server w/o any plugins and adding the plugins one by one. you might have installed some plugin that is not suited for large number of players.
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#12
Binaries are 32bit. they are emulated and do not run in long mode so they don't benefit from the larger address space, additional registers, etc. running a 32bit binary on a 64bit OS doesn't mean anything, really because all the syscalls are being emulated in compatibility mode.

dynamic ticks increase latency of timers because they are in a wake up mode / sleep mode.

From 2.6.21 changelog, when they were implemented:
"The downside is higher timer overhead (negligible in modern hardware, although some server-oriented distros package kernels with HZ=100 because of minor performance gains) and high pitch noises in some systems due to cheap, low-quality capacitors. "

So a HZ of 1000 + dynamic ticks = loss of performance, but increased power savings.
http://leaf.dragonflybsd.org/~gary

“The two most common elements in the universe are hydrogen and stupidity.”








Reply
#13
hmm..

Well they can cause, on the same server running; http apache, php, mysql, ssh2, libssh2, curl, proftpd

So it maybe?
Reply
#14
@Monk: I don't want a fight with you, but please stop talking about thinks you havn't understood.

32 bit binaries are not emulated on 64 bit platforms. There is no performance penalty w.r.t. 32 bit platforms. But the Linux kernel is more advanced on 64 bit and that will give you an actual advantage.

Timers always switch between sleep and wakeup, that's what they are for. There is no disadvantage in leaving out those timer interrupts that are not used. On the contrary that reduces the interrupt load and thus the cpu load. Can be easily seen by comparing both cases and having munin monitoring the system. that change log is several years old and no longer valid on recent systems. other important changes have happened like implementation of different clock sources like HPET.

As a matter of fact *all* timer interrupts caused by the kernel ticks are a waste for srcds, because srcds sets up its own timer (since a change in the timer structure of the kernel a long time ago). else my severs could not run with 1000 fps on a kernel with HZ=100, right?

@bakak: If the priorities and scheduling settings are correct for the srcds processes other background processes like apache and mysql usually do not have any consequences for srcds. The only known cause of performance problems despite of correct scheduling/priority settings is a high disk load. If you do not host really big sites you will be fine. Even the FPS meter does not present any problem - after I optimized the mysql cache not to stress the disk that much.

Try out different kernel settings, that cannot hurt. And try reducing the tickrate and fps even further. That can actually be better for servers with a high slot count.

PS: Sorry I hit sent too early...
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#15
I did not make this settings

"http://wiki.fragaholics.de/index.php/EN:Linux_Kernel_Optimization#Setting_your_servers_to_run_with_realtime_schedulin​g"

I need to do?

Edit: Yea! settings realtime scheduling and stable fps Smile

http://www.fpsmeter.org/p,view;75236.html

Thank to everyone :=)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)