RegisterRegister    Log inLog in    SearchSearch   

Post new topic   Reply to topic
Goto page 1, 2  Next 
View previous topic :: View next topic  
Author Message
ryguy222



PostPosted: Tue Aug 10, 2010 5:03 pm    Post subject: Feature Request, affinity, priority Reply with quote

Hello,
Just thought I'd throw this out into the mix, not sure if it was said already or not. But having the ability to control the priority and affinity via control panel would be marvelous.

Valve recommends running srcds at above normal priority, and there is quite a difference in performance. It's a bit of a hassle to login to Remote Desktop and set priority's and cpu affinity's. I am a GSP, and I have a quad core system, and a dual core system, and it's absolutely essential that I be able to evenly balance the servers, so that they all don't depend on the first core.

Also if anyone has a quick work around, to make programs start with preset affinity/priorities my ears are open Smile
Back to top
View user's profile Send private message
adbot



PostPosted: Thu Mar 31, 2011 3:57 am 

farmerbill256



PostPosted: Mon Aug 30, 2010 3:58 am    Post subject: Reply with quote

I highly recommend Priffinity 2 for Affinity and Priority Setting. It can reset the affinity if the server task crashes or restarts, and can differentiate between server tasks (some affinity setting programs will only set the affinity by the program name). I use it on a dual core server (which means setting affinity is quite important and highly recommend it.
Back to top
View user's profile Send private message
Cyber_Punk



PostPosted: Tue Aug 31, 2010 8:52 pm    Post subject: Reply with quote

I too would like to see this feature very nice suggestion.
Back to top
View user's profile Send private message
LukLuk



PostPosted: Mon Sep 06, 2010 7:40 am    Post subject: Reply with quote

Is there something similar for Linux? I would flip out if someone could call a program which is able to change priorities without losing the track of the process when it crashes Smile
Back to top
View user's profile Send private message
Andrew
Mammoth


PostPosted: Tue Sep 07, 2010 12:39 pm    Post subject: Reply with quote

Thanks for the feature suggestion.

We have internal support for process priority on Windows (Linux is not implemented, but can sort of be done using the 'nice' tool) and round-robin CPU core affinity (allocate the process to 1 core only round robin style).

Unfortunately at this time these features are not fully exposed to users, so you would need to manage this yourself.

I wonder if you can write a script that looks for 'srcds.exe' running (for example) and simply have that script apply the priority settings when it notices a new process with that name has started?

Writing it in a .Net console application would be my first choice.
Back to top
View user's profile Send private message
LukLuk



PostPosted: Wed Sep 08, 2010 3:35 pm    Post subject: Reply with quote

Hey Andrew, great to have you back Smile

Well, if the GameCreate Console would allow more commands (like nice -5 srcds_run -console -commands), this would likely help us.
Back to top
View user's profile Send private message
Kybber



PostPosted: Wed Sep 08, 2010 6:27 pm    Post subject: Reply with quote

That's no problem in Linux. Two options:

1. Create a script which runs every few minutes via cron and renices/reaffines processes.
2. Wrap the script which starts the game server (in your case srcds_run) with a script which does the renicing/reaffining of the original script.
Back to top
View user's profile Send private message
LukLuk



PostPosted: Thu Sep 09, 2010 2:44 am    Post subject: Reply with quote

It's sad that iam not that experienced in scripting or programming in linux.

Does "renice" have the ability to find process-NAMES? Otherwise I don't know how give it the according process-ID..... Sad

Thanks for you help btw Smile
Back to top
View user's profile Send private message
Kybber



PostPosted: Thu Sep 09, 2010 4:21 am    Post subject: Reply with quote

renice can't search for process names by itself, but you can find the pid in
a number of ways. I suppose the easiest is to use 'pidof'. The script can look
something like this:

Code:
#!/bin/bash
pids=`pidof srcds.x86`
for pid in ${pids}; do renice -5 ${pid}; done
Back to top
View user's profile Send private message
LukLuk



PostPosted: Thu Sep 09, 2010 7:24 am    Post subject: Reply with quote

Is this a working "script" or is it just to visualize your thoughts? Smile
Back to top
View user's profile Send private message
Kybber



PostPosted: Thu Sep 09, 2010 5:36 pm    Post subject: Reply with quote

It is untested, but I wouldn't be surprised if it works Smile

Try to run it as root while your servers are running. Use 'top' to verify that their niceness changed after running it. It it does work, simply add it to cron as root. If it doesn't work, let me know what goes wrong and I'll fix it.

Why root? Because in order to renice any process to a higher level (a lower number), you need the correct privileges.
Back to top
View user's profile Send private message
LukLuk



PostPosted: Fri Sep 10, 2010 12:43 am    Post subject: Reply with quote

Well, it doesn't report anything. Whenever I try to use "pidof" alone, it does not return anything, just jumps to the next line.

I've tried this:

Code:
#!/bin/bash
pids=`pidof scrds_run`
for pid in ${pids}; do renice -5 ${pid}; done


And in "top" it still says -10 in the category "NI". Any ideas?

EDIT: Interesting...... even putting "renice" by hand into the console leaves the process at "-10 NI".

Code:
78:~# renice -5 9510
9510: old priority -10, new priority -5
Back to top
View user's profile Send private message
Kybber



PostPosted: Fri Sep 10, 2010 7:50 am    Post subject: Reply with quote

First check which process actually runs. I wrote "srcds.x86" above, which is wrong. It should be srcds_somethingorother. To find out, type 'ps aux | grep srcds'. Then simply substitute whatever the process is called in the script where I wrote srcds.x86. Also, make sure you copied the script exactly, paying particular care to get the ` correct (note: ' and ` are not the same)

Which process reports -10 in the NI-column in top? srcds_something? If so it is already running at a high priority (the number is low because it is not being very nice to the other processes on your host). If that's what you want, then problem solved, no?
Back to top
View user's profile Send private message
LukLuk



PostPosted: Fri Sep 10, 2010 4:31 pm    Post subject: Reply with quote

The process is called "scrds_linux".

The script now says
Code:
#!/bin/bash
pids=`pidof scrds_linux`
for pid in ${pids}; do renice -5 ${pid}; done


I've copy-pasted it, so there should be no problem with ' and `.

Here a screenshot of all processes AFTER running the above script. As you see, no change in NI.

http://www.abload.de/img/screenshot-10.09.20100irbs.png

The problem is, that the script does not seem to change anything.... A manual "renice -5 PID" works.

EDIT: If you simply type in "pidof srcds_linux" and send it, should there be any output?
EDIT2: Oh, there is xD

EDIT3: Oh god damn.......it works. As you see above, there is a typo "scrds_linux != srcds_linux". Nevermind, it works Smile

EDIT4: Ok, another problem. What do I have to type in, if I have different CoD4 servers running? A simple "pidof "Reign of the Undead 1"" does not work.

Thanks for your great help!
Back to top
View user's profile Send private message
Kybber



PostPosted: Fri Sep 10, 2010 4:43 pm    Post subject: Reply with quote

Great! I'm assuming that this is the only remaining question?
LukLuk wrote:
EDIT4: Ok, another problem. What do I have to type in, if I have different CoD4 servers running? A simple "pidof "Reign of the Undead 1"" does not work.

The original script iterates over all running srcds_linux processes, so if you want the same niceness for all your COD4-servers, simply replace "srcds_linux" with "cod4_lnxded-bin".

LukLuk wrote:
Thanks for your great help!

Glad to be of assistance Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic All times are GMT + 10 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum powered by phpBB © 2001, 2005 phpBB Group
GameCreate Service Terms | Privacy Policy | © Copyright Mammoth Media 2001-2007
GameCreate™ is a trademark of Mammoth Media Pty Ltd. GameCreate® is a registered trademark in Australia.