Code Comments

Code Comments

Tips and short tutorials on various programming technologies

Code Comments RSS Feed
 
 
 
 

How to Increase the Priority of a Process in Linux

In Linux, you have the ability to determine which processes are running at a given time on the server. This post explains how to do this using the top command.

Let’s say you have a process that is not getting as much CPU time as you would like, maybe because it is getting beat out by another process. Well, one of the columns displayed by the top command is NI. This stands for NICE and is an integer value between -20 and 19. Lower values mean that the process is “less nice” to other processes, while higher values mean the process is “nice.” These values determine how CPU cycles are allocated.

To increase the priority of a given process, get the PID and use the renice command to change it.

For example, let’s say you have a process with a PID of 1000 and want to make it very unnice. You would do the following at the command line:

renice -20 1000

Leave a Reply