STEAM GROUP
Linux Game Server Managers linuxgsm
STEAM GROUP
Linux Game Server Managers linuxgsm
80
IN-GAME
649
ONLINE
Founded
February 9, 2015
eXile Feb 29, 2016 @ 1:52pm
High Priority Process possible?
So I just got my rust server transferred over to Linux(200k entitities) and everything is running smoothly! Before, I used to run the server on Windows and I was able to set the RustDedicated process to high priority. Is it possible to do in linux?
< >
Showing 1-9 of 9 comments
Mazer Feb 29, 2016 @ 2:08pm 
Sure. The command is 'nice'. To increase the CPU allocation, you decrease the nice level. This must be done as root.
eXile Feb 29, 2016 @ 2:22pm 
So whats the lowest 'nice' level i can go?
eXile Feb 29, 2016 @ 2:24pm 
root@rust:~# nice -20
nice: a command must be given with an adjustment
Try 'nice --help' for more information.

I'm getting that error.
eXile Feb 29, 2016 @ 3:04pm 
Also, just had an issue with the sleeping bag system breaking. No one is able to spawn on the bags they put down at all.
Mazer Feb 29, 2016 @ 4:41pm 
Originally posted by {HH} eXile1cK:
Also, just had an issue with the sleeping bag system breaking. No one is able to spawn on the bags they put down at all.
Completely off topic for this thread. Post in a separate one, please.
Mazer Feb 29, 2016 @ 4:48pm 
Originally posted by {HH} eXile1cK:
root@rust:~# nice -20
nice: a command must be given with an adjustment
Try 'nice --help' for more information.

I'm getting that error.
That's because you need to actually indicate the process you want to 'nice'.

All answers to your questions are accessible through
man nice renice
But to cut to the chase, try (as root)
renice -1 $(ps aux|grep RustDedicated|grep -v tmux|grep -v grep|awk '{print $2}')

(That's a single one-liner. Steam wraps the line.)

Don't go overboard with -20. A simple "-1" value will put it on the CPU over all userland processes, and you actually want the disk I/O processes and various system-level tasks to be able to their jobs, too.
Last edited by Mazer; Feb 29, 2016 @ 4:56pm
UltimateByte Feb 29, 2016 @ 10:49pm 
BTW, some stuff in Rust, wether it's the Windows or Linux version is pretty unoptimized. You will always get a little rollback when the server is autosaving for example, and the amount of the rollback will probably depend on your monothread power, as this process is on the same thread as the main game server. Blame Facepunch for that btw. Also blame Facepunch for the server using half a core even when empty (regardless if it's a windows or linux server).

If you're starting to need prioritizing to get it running decently, you'd better look for a more powerful server, OR, seek for addons messing your server up.
eXile Mar 2, 2016 @ 6:53pm 
Also, do I have to enter "renice -1 $(ps aux|grep RustDedicated|grep -v tmux|grep -v grep|awk '{print $2}')" everytime my server boots up after a restart?
Mazer Mar 2, 2016 @ 7:36pm 
First, note that I don't think that this is very useful, personally.

That being said, if you are only going to run one Rust server ever, you can simply put this as a crontab task for root that executes every hour. If the server's running, it'll be nice-adjusted to -1, if the Rust server isn't running for some reason, no harm. The crontab entry for root to run hourly would be:
0 * * * * renice -1 $(netstat -nap | grep ":28015" | grep udp | rev | awk '{print $1}' | rev | cut -d\/ -f1) 2>/dev/null || /bin/true

I changed it a bit so as to be more "reliable," in the sense that the former command has the possibility of picking a process id that doesn't belong to the Rust server.

The above grabs whatever process is listening on port 28015 and UDP (the Rust server, if you're using the standard ports) and renice's it to -1. It's more specific inasmuch as it grabs the specific process listening on the port, whereas the former command (above) just grabs anything with RustDedicated in the process list, and assumes that there's just one (that's not a good assumption).

If I were automating this, I'd use this latter approach as it's less apt to picking a false process id.

Edit the crontab as root with:
crontab -e
Last edited by Mazer; Mar 3, 2016 @ 4:36am
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Feb 29, 2016 @ 1:52pm
Posts: 9