SRCDS Steam group


Worried about CPU usage...
#1
Hello everybody.

I own a GSP, and today when i was checking the load on the physical servers. A lookup surprised me.

Some idle private servers were using 20% cpu (without source tv). They were jumping from 1 to 25%. They could be at 1% and then jump to 20-25% and stay there for minutes, and then jump down again. I cant see the cpu usages in htop, but it shows in top. Heres the readme-info:

Ubuntu 9.10 x64 (server, standard kernel)
Phenom 965 3.4 ghz QC
4 GB of ram (DDR2)
750 GB hdd
Internet: 1000/1000 Mbps


Just took at stats on a idle server without any plugin or stv enabled

12:21:42 CPU In Out Uptime Users FPS Players
20.20 0.00 0.00 2 0 234.19 0
12:21:43 stats
12:21:43 CPU In Out Uptime Users FPS Players
20.20 0.00 0.00 2 0 271.59 0
12:22:24 stats
12:22:24 CPU In Out Uptime Users FPS Players
19.50 0.00 0.00 3 0 234.69 0
12:22:25 stats
12:22:25 CPU In Out Uptime Users FPS Players
19.50 0.00 0.00 3 0 290.70 0
12:22:25 stats
12:22:25 CPU In Out Uptime Users FPS Players
19.50 0.00 0.00 3 0 236.46 0
12:22:25 stats
12:22:25 CPU In Out Uptime Users FPS Players
15.67 0.00 0.00 3 0 257.93 0
12:22:25 stats
12:22:26 CPU In Out Uptime Users FPS Players
15.67 0.00 0.00 3 0 236.24 0
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#2
No one doesn't know what it might be? Sad
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#3
cpu usage is crap. linux isn't able to measure it. and the stats command outputs anything but a reliable cpu usage. simple reason: the linux kernel samples cpu usage at best 1000 times per second (once per kernel tick, like set with the CONFIG_HZ option). if the server has 1000 fps it means it switches 1000 times per second between the sleeping and the running state. so how should the kernel estimate the cpu usage? you can simply ignore it.
look at other values instead. e.g. the "uptime" command prints the "load average", i.e. the number of processes in 'runnable' state at the same time (average over 1, 5 and 15 minutes). 'runnable' means the process wants to have cpu time. so a 'runnable' proccess it is either waiting until a cpu is free or it is already running. values of the "load average" higher than your number of cpus clearly indicates an overload. in fact for game servers it should always be considerably lower than your number of cpus. unfortunately I do not know a way to obtain this value for single processes...
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
Well im looking on both htop and top, and it shows different usage (look at pictures below)

HTOP:

[Image: 14xgbvs.jpg]

TOP:

[Image: 33c9gy1.jpg]

This seems strange, and it affects the performance on the other gameservers
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#5
read what I wrote? cpu usage is strange for srcds/hlds. just ignore it
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
I'm not a master of HL servers (at least since Steam came out, I used to run an old dedicated server before then for counterstrike 1.4 and the old TFC) - so please don't take the below as gospel. However, this is how I understand it:

Spikes in CPU usage for internet hosting applications are not unusual, they usually result from the server spinning off child processes to respond to queries. In HLDS/SRCDS' case this is usually the server responding A: to the Steam master servers, or B: to players connected to the game. Even if the game server is idle it still has to send heartbeat pulses to the Steam master servers to register on the master server game list and if it has Valve Anti-Cheat enabled this will also require heartbeat pulses.

CPU use spikes are only an issue in this case, I should think, if they are happening quite frequently - ie the server spastically goes from 3.0 to 0.x usage repeatedly - this is usually a sign of a software fault or someone trying to crash the server with a buffer overrun exploit - or if they are not really spikes, ie something is causing the server to take large amounts of server time regularly.

This may seem tangential to ask, but are you running AMX Mod? You should reconsider, if you are, both because it is no longer supported and there are outstanding exploits, and because the mod itself in my pre-steam experience has a tendancy to hog much more processor time than it really should.
Reply
#7
I am not running any kind of plugins Smile

@BehaartesEtwas - Yes i know, but i still find it strange that top registers the usage, and htop doesnt (while running both program on the same time)
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#8
"ie the server spastically goes from 3.0 to 0.x usage repeatedly" - probably the server doesn't really do this, it only shows it due to the wrong measurement.

Quote:@BehaartesEtwas - Yes i know, but i still find it strange that top registers the usage, and htop doesnt (while running both program on the same time)
because they access different sources of data. I know this behaviour, this made me think about how linux would measure the cpu usage of a process like srcds. it's simply impossible. you cannot trust any of those numbers ever. basta Toungue
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
(04-22-2010, 05:55 PM)BehaartesEtwas Wrote:  "ie the server spastically goes from 3.0 to 0.x usage repeatedly" - probably the server doesn't really do this, it only shows it due to the wrong measurement.

No, these measurements are usually correct, they simply are showing that CPU usage is spiking intermiddently, usually the result of child processes being spun off by a server application that are taking too much processor usage when made. This happens with faulty Apache modules, for example, and it can also happen with bad Metamod plugins, and in particular AMX is horrible for that kind of thing in my experience which is why I asked if he was using AMX.

(04-22-2010, 05:55 PM)BehaartesEtwas Wrote:  @BehaartesEtwas - Yes i know, but i still find it strange that top registers the usage, and htop doesnt (while running both program on the same time)
Quote:because they access different sources of data. I know this behaviour, this made me think about how linux would measure the cpu usage of a process like srcds. it's simply impossible. you cannot trust any of those numbers ever. basta Toungue

It is important to understand how the metrics you are using are generated. CPU time is more accurate on Linux than it is on Windows but if you do not understand how it is being generated then it is unhelpful.

If you're technically proficient and have root access, you can use Webalizer to monitor server resource usage. You just have to configure a program to monitor CPU and bandwidth usage and output it to a log. There is a tutorial for that somewheres on the Webalizer site though of course it is not SRCDS specific.
Reply
#10
You havn't read what I wrote. CPU usage cannot be accurate for simple but fundamental reasons. You can be lucky and get reasonable values but there is no way of knowing the real usage. End of discussion.
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
#11
So whats the point then.. The server got 1-5% usage totally or..? Smile
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#12
(04-23-2010, 05:59 PM)lol554 Wrote:  The server got 1-5% usage totally or..? Smile

says who?

the point is, that number is most probably wrong. it could be 0.1% or 20% as well, nobody knows.
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


Forum Jump:


Users browsing this thread: 6 Guest(s)