Multiple Servers

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
dandsk
A regular
A regular
Posts: 33
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Mar 29, 2014 6:15 pm

Multiple Servers

Post by dandsk »

Hey, I plan to do an upgrade to host multiple servers on the same machine within a couple of hours, and need a question answered fast!

I host Garry's Mod servers, and plan to open another 2 on a VDS.

Would I need to set the affinity of each game server, or is there no difference leaving as-is (performance loss)? If yes, then how would I do it so when I run a .sh script, it automatically assigns this server to core 1, this server to core 2, etc instead of starting the servers, checking the PID's, and typing the commands to assign the servers to the cores.

Thanks!
User avatar
kraze
Former staff
Former staff
Posts: 4362
Joined: Fri Sep 17, 2010 9:06 am
Location: California

Re: Multiple Servers

Post by kraze »

You don't need to do this and I don't recommend doing so, letting the OS handle it is normally the best option.
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
dandsk
A regular
A regular
Posts: 33
Joined: Sat Mar 29, 2014 6:15 pm

Re: Multiple Servers

Post by dandsk »

The VDS is running Debian 7.

I will let the servers run without affinity set for now, and monitor to see if there is somewhat extra performance I can gain if I set affinity's.

Thank you!
dandsk
A regular
A regular
Posts: 33
Joined: Sat Mar 29, 2014 6:15 pm

Re: Multiple Servers

Post by dandsk »

I left the servers running without taskset set on them, and it was bad.

There was major performance loss on both servers. As one of the CPU's was 100%, it jumped to the second CPU. With this happening 66 times a second on each server, the tickrate was jumping up and down continuously, thus causing mini lag spikes.

I set taskset on each server so it has its own core to run on, and I gained a lot more performance. But I had to do this by manually typing the command in a SSH window after the server started up.

My issue here is if there is a way I can automatically assign this server to start up to its affinity set to this core. I am not here 24/7, so I can't manually do it. And when the server crashes, the PID changes and it automatically assigns itself to all cores. Is there some kind of script or cronjob I can use to automatically assign this server to core 1, and the other to core 2, and so on anytime it starts up?

Really need help with this fast!
dandsk
A regular
A regular
Posts: 33
Joined: Sat Mar 29, 2014 6:15 pm

Re: Multiple Servers

Post by dandsk »

I found two forum posts that are related to the problem I am having, and seem like good solutions. But I am having difficulty setting this up.

Posts:
http://www.linux-noob.com/forums/index. ... c-cpu-smp/
http://www.linux-noob.com/forums/index. ... processes/


So for the second post, I created the .sh file and put it in the directories of each server. For the first post, I then tried to do:

Code: Select all

screen -m -d -s -- taskset -c 3 ./server1.sh
part, and it failed. It kept spitting out "No such file or directory" or sometimes "Permission denied."

This is what I used:

Code: Select all

taskset -c 0 /home/steam/servers/server_test/autorestart.sh
but it keeps spitting out "No such file or directory."

So then I did:

Code: Select all

taskset -c 0 /home/steam/servers/ ./autorestart.sh
and it spat out "Permission denied."

I don't know how to set the location of the .sh file for this command. Please help!
Post Reply