Raised This Month: $12 Target: $400
 3% 

Solved [Ubuntu] Starting HLDS with a higher priority


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 08-27-2017 , 08:17   [Ubuntu] Starting HLDS with a higher priority
Reply With Quote #1

Hello Guys!
I've been using Ubuntu 16.04 LTS for my HLDS server for the past 2 years. The server wasn't famous so with the amount of plugins it ran fine but now it's famous lot of people come so the fps were quite unstable so I upgraded the machine from the VPS hosting and saw that the same thing happened. So I followed a few guides and compiled a kernel with some custom settings, changing the process's priority and it's scheduling policy I saw that the server ran quite stable but the server starts by a startup script and I don't have time to change the process's priority and scheduling policy everytime. Is there anyway that I can make it start at a higher priority + the scheduling policy?

The commands I've been using are:

The Schedule policy cmd:
Code:
chrt -p -r 99 pid
Renice:
Code:
renice -20 pid
I've heard of the task set command anyway to do it?

Startup script:
Code:
cd /home/steam/Steam/cs/&&screen -A -m -d -S server ./hlds_run -game cstrike -ip 35.154.172.22 +port 27015 +map de_dust2 +maxplayers 32 -exec server.cfg -pingboost 2 +fps_max 1100 -condebug

Last edited by WhiteFang1319; 08-28-2017 at 08:25. Reason: Solved.
WhiteFang1319 is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-27-2017 , 08:36   Re: [Ubuntu] Starting HLDS with a higher priority
Reply With Quote #2

change the startup script to :
PHP Code:
cd /home/steam/Steam/cs/&&screen ----S server nice --20 chrt -r 90 ./hlds_run -game cstrike -ip 35.154.172.22 +port 27015 +map de_dust2 +maxplayers 32 -exec server.cfg -pingboost 2 +fps_max 1100 -condebug 
__________________
JusTGo is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 08-27-2017 , 09:48   Re: [Ubuntu] Starting HLDS with a higher priority
Reply With Quote #3

Quote:
Originally Posted by JusTGo View Post
change the startup script to :
PHP Code:
cd /home/steam/Steam/cs/&&screen ----S server nice --20 chrt -r 90 ./hlds_run -game cstrike -ip 35.154.172.22 +port 27015 +map de_dust2 +maxplayers 32 -exec server.cfg -pingboost 2 +fps_max 1100 -condebug 
Thank you but the server doesn't even start. I can't even see the screen process.
WhiteFang1319 is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-27-2017 , 09:51   Re: [Ubuntu] Starting HLDS with a higher priority
Reply With Quote #4

make sure you have root access
__________________
JusTGo is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 08-27-2017 , 10:27   Re: [Ubuntu] Starting HLDS with a higher priority
Reply With Quote #5

Quote:
Originally Posted by JusTGo View Post
make sure you have root access
The script is started by root only. I use the default /etc/rc.local script and have added the line to start the server.
WhiteFang1319 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-27-2017 , 14:42   Re: [Ubuntu] Starting HLDS with a higher priority
Reply With Quote #6

Running any process that is open to the internet as root is risky. If you are only doing it for a personal LAN situation, it won't matter.
__________________
fysiks is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-28-2017 , 07:44   Re: [Ubuntu] Starting HLDS with a higher priority
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
Running any process that is open to the internet as root is risky. If you are only doing it for a personal LAN situation, it won't matter.
well he needs root access for chrt command.
__________________
JusTGo is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 08-28-2017 , 08:24   Re: [Ubuntu] Starting HLDS with a higher priority
Reply With Quote #8

Quote:
Originally Posted by JusTGo View Post
change the startup script to :
PHP Code:
cd /home/steam/Steam/cs/&&screen ----S server nice --20 chrt -r 90 ./hlds_run -game cstrike -ip 35.154.172.22 +port 27015 +map de_dust2 +maxplayers 32 -exec server.cfg -pingboost 2 +fps_max 1100 -condebug 
Thanks for your response. What I did was make an executable named server and added this line:
PHP Code:
chrt -r 99 nice --20 ./hlds_run -game cstrike -ip 35.154.172.22 +port 27015 +map de_dust2 +maxplayers 32 -exec server.cfg -pingboost 2 +fps_max 1100 -condebug 
and I just changed the startup in /etc/rc.local to:
PHP Code:
cd /home/steam/Steam/cs/&& screen ----S server ./server 
Now it starts with the highest priority (-20) and it's scheduling policy is RealTime
[Wrote this here because it may help someone]

Last edited by WhiteFang1319; 08-28-2017 at 08:24.
WhiteFang1319 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode