SRCDS Steam group


idler.c
#1
Hello,

I was doing an upgrading and patching of my kernel over these guide:

http://wiki.fragaholics.de/index.php/EN:Linux_Kernel_Optimization

First I would like to gratified with you, best guide ever for CS server admins. I got 1000FPS on server for first time. Finnaly Smile

But now I would like to stabilize FPS, because I have some drops for 5 to 10 fps. I am stacked at these point: http://wiki.fragaholics.de/index.php/EN:Linux_Kernel_Optimization#Eliminate_small_Variations_with_.22idler.22

with idler.c

First for starting these script. Do I have to put it in background? Like these:

~# nice ./idler &

With & at the end? to put it in background?

Second, in the guide it writes like these:
Code:
You should run the program at low priority to aviod slowing down your system:

nice ./idler

How I can run these process with low priority?

And for last and third, when I start these script I think it gets a bit too much CPU? Or is these normal?

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6861 root 30 10 1604 268 216 R 86 0.0 0:15.56 idler


Thank you!
Reply
#2
Idler should account for any cpu left over or "idle" that the core is not using. And yes you run the idler in the background nice is not necesary if you run your game server on a designated core be sure to run the idler on the same core ex: taskset -c 1 ./idler &
*Windows lack of output*
You: Hey, I want to run this program!
Windows: Ok.. It crashed... Now what? Give up?
You:...wtf...
*linux output helpful?*
You: ./My_program
Linux:...Failed!...oo kitties!
You:...wtf...
Reply
#3
aha. So it is normally that idler use so much CPU?

I am running more game servers so I just start normally the process without taskset?
Reply
#4
blindek Wrote:With & at the end? to put it in background?
correct, this puts it in the background. there are other methods, but this will do fine.

blindek Wrote:How I can run these process with low priority?
"nice" runs the process with low priority, so the command is correct in that form.

blindek Wrote:And for last and third, when I start these script I think it gets a bit too much CPU? Or is these normal?
the idea of the idler is to use much cpu. I did not understand how this improves the fps, but it seems to work in many cases (must be some effect deep in the kernel). as you run the process niced (i.e. with low priority) it will not affect the system performance.

afterhoursgaming Wrote:nice is not necesary if you run your game server on a designated core be sure to run the idler on the same core ex: taskset -c 1 ./idler &
first: you have always other processes running on your server (e.g. ssh to login and maintain the server), so you should always nice the idler. the game servers are not affected in any case, as they should run on realtime/fifo priority (using chrt).
second: I would not recommend binding either the idler nor the game servers to a specific core. this only reduces the the number of options the linux scheduler has to run your servers as fast as possible. the linux scheduler is doing a great job on its own, you shouldn't interfere there...
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
#5
Ok thank you. I will today try to play a bit around these idler and report the effect and if FPS will be stabilized.

Also, a bit offtopic but esential for FPS. How much it can get CPU load in % that it won't get any lag on server? So how high can be the % CPU load to works fine for game servers?

Is these too much?

top - 20:58:44 up 6:40, 1 user, load average: 3.26, 2.94, 2.76
Tasks: 191 total, 1 running, 190 sleeping, 0 stopped, 0 zombie
Cpu(s): 25.0%us, 3.7%sy, 0.0%ni, 70.7%id, 0.2%wa, 0.1%hi, 0.4%si, 0.0%st
Mem: 12411140k total, 6100728k used, 6310412k free, 103408k buffers
Swap: 1951856k total, 0k used, 1951856k free, 3010076k cached

is these machine overloaded? for you?
Reply
#6
nobody can answer you that question. this varies very much among different kernel-versions and systems. in particular you cannot really rely on the values itself, sometimes e.g. top and htop give very different values... if you have stable fps, your system is ok. if your fps drop when your servers get full, your system is overloaded...
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
#7
I have created a idler

Code:
cd /srcds

Code:
nano idler.c

pasted this inside:

Code:
int main() {
  while(1);
}

then i run:

Code:
gcc idler.c -o idler

Putted this in /etc/crontab

Code:
@reboot /usr/local/sbin/idler.sh

Idler.sh inneholds:

Code:
/bin/sh
# Start the idler
cd /srcds
nice ./idler &

To check if it runs
Code:
ps -A




Get this error msg:

Code:
2374 ?        00:00:00 idler.sh <defunct>
2375 ?        00:25:52 idler



So it seems to work atleast halfway. There is a idler there that not work. When i tryes to check with chrt and the correct pid i get this

The working one:

Code:
pid 2375's current scheduling policy: SCHED_OTHER
pid 2375's current scheduling priority: 0


So whats wrong. Is that the correct priority and why does i have two of them?

Code:
cat /var/log/messages /var/log/syslog | grep idler

Gives me:

Code:
Mar 18 17:17:16 c-94-255-210-250 /USR/SBIN/CRON[2370]: (root) CMD (/srcds/idler.sh)
Mar 18 17:24:37 c-94-255-210-250 /USR/SBIN/CRON[2364]: (root) CMD (/srcds/idler.sh)
Mar 18 17:44:28 c-94-255-210-250 /USR/SBIN/CRON[2353]: (root) CMD (root  /usr/local/sbin/idler.sh)
Mar 18 17:55:59 c-94-255-210-250 /USR/SBIN/CRON[2374]: (root) CMD (/usr/local/sbin/idler.sh)
Reply
#8
is there a way to make the idler run forever?
Reply
#9
Code:
./idler &
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
#10
The idler wont work for me as i posted abowe. I get two of them. Can anyone help me with that issue.
Reply
#11
lhffan Wrote:The idler wont work for me as i posted abowe. I get two of them. Can anyone help me with that issue.

Like it downloads a new of it?
Reply
#12
no?

I have created a idler.c and compiled it and then i have putted it into my /srcds folder. The problem is how do i start the idler automaticly
Reply
#13
define "not working". doesn't it improve your fps?

there are several ways to make a program starting at boot automatically. most of them depend on the distribution (e.g. on debian & friends you can put it into /etc/rc.local with an & at the end of line - else it will hang your boot process). one platform independent way is to put it into /etc/crontab with "@reboot" in front.

you could also put "pidof idler || ./idler &" into whatever script you use to start the game servers.
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
#14
The problem is that it starts two instances of the idler

EDIT:
So my startscript could look like this?

Code:
/bin/sh
# Start the idler
cd /srcds
pidof idler || ./idler &
Reply
#15
try it...

if your scripts start two instances of the idler, its not the idlers fault ;-)
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: 3 Guest(s)