Linux : Changing process priority

By | April 1, 2013

Here is a quicky how to change/modify the priority of a process on your system task scheduler. I will first explain how to change the priority of an existing process and then for new processes.

1. Find out the current priority either using “top” or with the specific process ID :

ps -o pid,comm,nice -p <PROCESS_ID>

2. Then set the new priority :

renice <PRIORITY> -p <PROCESS_ID>

 

Now let’s do it for new processes :

nice -n <PRIORITY> <PROCESS_NAME>

You can also set this for specific users editing the “limits.conf” file :

vi /etc/security/limits.conf

Enter the parameters as following :

<USER> <HARD or SOFT limit> priority <VALUE>

Example :

myusername hard priority 20