Posts: 80
Threads: 7
Joined: Nov 2009
Reputation:
0
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 ?
Posts: 226
Threads: 2
Joined: Aug 2009
Reputation:
1
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.
Posts: 2,031
Threads: 27
Joined: Nov 2008
Reputation:
17
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)
Posts: 80
Threads: 7
Joined: Nov 2009
Reputation:
0
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
Posts: 2,031
Threads: 27
Joined: Nov 2008
Reputation:
17
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)?
Posts: 80
Threads: 7
Joined: Nov 2009
Reputation:
0
06-15-2010, 12:51 AM
(This post was last modified: 06-15-2010, 12:54 AM by bakak.)
Posts: 226
Threads: 2
Joined: Aug 2009
Reputation:
1
Too much context switching.
Posts: 2,031
Threads: 27
Joined: Nov 2008
Reputation:
17
06-15-2010, 05:25 PM
(This post was last modified: 06-15-2010, 05:25 PM by BehaartesEtwas.)
what kernel do you run? give us the output of
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
Posts: 80
Threads: 7
Joined: Nov 2009
Reputation:
0
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
Posts: 226
Threads: 2
Joined: Aug 2009
Reputation:
1
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.
Posts: 2,031
Threads: 27
Joined: Nov 2008
Reputation:
17
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.
Posts: 226
Threads: 2
Joined: Aug 2009
Reputation:
1
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.
Posts: 80
Threads: 7
Joined: Nov 2009
Reputation:
0
hmm..
Well they can cause, on the same server running; http apache, php, mysql, ssh2, libssh2, curl, proftpd
So it maybe?
Posts: 2,031
Threads: 27
Joined: Nov 2008
Reputation:
17
06-17-2010, 08:43 PM
(This post was last modified: 06-17-2010, 08:55 PM by BehaartesEtwas.)
@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...
Posts: 80
Threads: 7
Joined: Nov 2009
Reputation:
0
06-17-2010, 11:17 PM
(This post was last modified: 06-17-2010, 11:38 PM by bakak.)
I did not make this settings
"http://wiki.fragaholics.de/index.php/EN:Linux_Kernel_Optimization#Setting_your_servers_to_run_with_realtime_scheduling"
I need to do?
Edit: Yea! settings realtime scheduling and stable fps
http://www.fpsmeter.org/p,view;75236.html
Thank to everyone :=)
|