How to install and use System Priority SPRI

Ideal place for discussions related to Linux/Windows server security, Apache, MySQL, MS SQL and PHP, including tutorials and questions.
hrdedicated
Site Admin
Posts: 50
Joined: Thu May 30, 2013 10:28 pm

How to install and use System Priority SPRI

Postby hrdedicated » Sat Jun 01, 2013 12:00 pm

SPRI (System Priority)

Introduction:

SPRI is a utility designed to queue different processes with different priority levels based on 3 class levels of importance (high,med,low).
The problem? Linux has priority levels to thread all tasks at, these prio’s are ranged from -20 to +19 (negative = high prio, positive = low prio) with 0 as the default for all processes. So this being the fact, with everything operating at prio 0 you got fights between services as to who gets what resources first.
Solution? Very simply, que different processes at different priority levels to effectively discipline the system on who gets what resource access first.
The average load level of a server can be substantialy decreased by using SPRI, by as much as 5-20%, of course results may vary.
To install SPRI, execute the following commands (as root):

Installation:

1. cd /root/download

2. Download the source

wget http://www.r-fx.ca/d...-current.tar.gz

3. Untar it

tar -zxvf spri-current.tar.gz

4. cd spri-0.5

5. ./installer.sh

SPRI is now installed. Next, edit the set of files at /usr/local/spri/prios/. These set of files define the priority of different processes. For e.g. /usr/local/spri/prios/high contains a single entry – httpd. This indicates that httpd (Apache server) will be run with the highest priority.

The changes we need to make are as follows (done as root):

Edit /usr/local/spri/prios/med and ensure that it contains the processes qmail, MailScanner and spamd [one per line].
Edit /usr/local/spri/prios/med-high and ensure that it contains the processes mysqld and mysqld-max [one per line].
Edit /usr/local/spri/prios/low and ensure that it contains the processes awffull, clamav, clamdscan, freshclam and python2.2 [one per line].
Edit /usr/local/spri/prios/low-med and ensure that it contains the processes php, php-script and proftpd [one per line].
If you are running any other applications, experiment and see which is the right priority with which you want the application to run, and add it to one of these files accordingly.

Run SPRI by executing the command: /usr/local/sbin/spri -v. SPRI will set the priorities of the processes defined and ensure they are run at their set priorities.
The SPRI installer automatically installs a cron job that runs every 45 minutes to check whether the priorities of the processes are as defined and set them accordingly if they are changed.

6. To check it, fire : /usr/local/sbin/spri –v

Return to “System Security”

Who is online

Users browsing this forum: No registered users and 2 guests