SRCDS Steam group


renice on multi-core cpu
#1
First off, thanks for this site. A week ago I set up a dedicated box and this site has been an awesome resource.

Currently I run 2 24 slot TF2 servers and 1 CSS match server on our box

Specs:
Q6600 2.4Ghz (quad core obviously)
4Gigs RAM
CentOS

All of the servers work great, I'm not trying to push them really that hard, 66 tick for the tf2 and 100 for the css. My question is, if I set up the renice cron jobs for all 3 servers like your tutorial says, will it set priority to the srcds instance ON EACH CORE? If so, then technically on my setup you could run 4 servers (1 instance per core) with them all renice'd to have them all working at their fullest.

Thanks in advance for your guidance.
#2
no, it will only increase its processing priority, to set it to the cores use
taskset
#3
OK, could you give some insight on setting taskset, I've never had to do it in linux before? It was my understanding when you start up your instance of the srcds it would align itself with the 'free-est' core. Would it jump around from core to core or just stay on the one?
#4
if it's an existing process then: taskset -pc pid core, so if you want to set process 3241 to core 4 it would be: taskset -pc 3241 3 (cores start at 0 so 4 cores are numbered 0-3)

if you want to start a new process then i find it easiest to make 2 startups, one that will taskset the second one. so if your startup script is startserver.sh then make one that is:

taskset -c core# pathto./startserver.sh
#5
Thanks for the information. What is you opinion on it? Do you think setting affinity is a good thing to do? Seeing as I have 4 cores and only 3 servers, it seems like the smart thing to do to ensure each it getting a dedicated portion of the cpu.
#6
Don't use taskset for srcds, it causes performance and fps issues.
Game Server Administration Services
Linux & Windows performance specialist.
http://www.viGeek.net
#7
vigor Wrote:Don't use taskset for srcds, it causes performance and fps issues.

if you do it to a process that has already been started then yes i have seen it, if you do it while starting a process then it has worked every time.
#8
fqdn Wrote:if you do it while starting a process then it has worked every time.

I agree. I run a single TF2 server on a dualcore cpu, and never had any problems using taskset at process start. I have locked my TF2 server to one core, but that didn't really change much. Later I found out how to restrict the rest of Linux (webserver, ftp, ssh, samba, X etc.) to the other core, and that was very noticeable. Intermittent lag in TF2 whenever someone was browsing my photogallery (php based and quite cpu hungry) is now a thing of the past. And no need for cronjobs with renice.

To accomplish this, just add these lines at the top of /etc/rc.d/rc.sysinit:

# Set default affinity to cpu 0
# Cpu 1 reserved for TF2 server
/bin/taskset -p 1 1
/bin/taskset -p 1 $$

Everything will now run on the first core only, unless assigned to another one by taskset.
#9
(05-26-2008, 04:42 PM)Svuppe Wrote:  
fqdn Wrote:if you do it while starting a process then it has worked every time.

I agree. I run a single TF2 server on a dualcore cpu, and never had any problems using taskset at process start. I have locked my TF2 server to one core, but that didn't really change much. Later I found out how to restrict the rest of Linux (webserver, ftp, ssh, samba, X etc.) to the other core, and that was very noticeable. Intermittent lag in TF2 whenever someone was browsing my photogallery (php based and quite cpu hungry) is now a thing of the past. And no need for cronjobs with renice.

To accomplish this, just add these lines at the top of /etc/rc.d/rc.sysinit:

# Set default affinity to cpu 0
# Cpu 1 reserved for TF2 server
/bin/taskset -p 1 1
/bin/taskset -p 1 $$

Everything will now run on the first core only, unless assigned to another one by taskset.
Ive been using this on Centos and has been great but have just gone over to Debian squeeze and putting
/usr/bin/taskset -p 1 1
/usr/bin/taskset -p 1 $$

in rc.local sets pid 1 to mask 1 but services like vsftpd and mysql are still jumping from core to core, anyone have any ideas?
Also noticed that the commands are being action after mysql and vsft services are started but befor it go's into run level 3.
*SOLVED* for Debian place it in /etc/init.d/rcS
#10
Please do not raise old, dead threads from the dead. If you need similar help, please feel free to post your own thread with your question. Remember to read the required READ ME FIRST thread for the area in which you are posting.

Thread Locked.
~ Mooga ...w00t? - SRCDS.com on Twitter
[Image: 76561197965445574.png]
Please do not PM me for server related help
fqdn Wrote:if you've seen the any of the matrix movies, a game server is not all that different. it runs a version of the game that handles the entire world for each client connected. that's the 2 sentence explanation.


Forum Jump:


Users browsing this thread: 4 Guest(s)