SRCDS Steam group

SRCDS High Cpu Usage Problem! Please Help

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
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....
CPU   In    Out   Uptime  Users   FPS    Players
94.00 122750.63 340064.14    1224    25  845.60      32

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

Intel Xeon E5520 8 core cpu
8 GB DDR3 memory
100mbit network

Please help me, why usage high cpu ? Sad
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.

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

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) (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
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
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)? (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Omg :\,view;74781.html
30 players playing at this time
Too much context switching.

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

what kernel do you run? give us the output of
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 (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
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;
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.

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

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. (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
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.

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


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

So it maybe?
@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... (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
I did not make this settings


I need to do?

Edit: Yea! settings realtime scheduling and stable fps Smile,view;75236.html

Thank to everyone :=)

Forum Jump:

Users browsing this thread: 1 Guest(s)