The UNIX Renice program can be used to alter the priority of running processes. This is handy if you want to have a processor intense program run in the background without slowing down other programs.
On UNIX you need to use top to find out the Process ID (PID) of the process you want to change with renice.
On Mac OS X you can use top or Activity Monitor to find out the Process ID. Activity Monitor is located in the /Applications/Utilties folder
A Process ID (PID) is an unique number that the system uses to identify every running program on the system. The PID number for each program changes between reboots.
In this example I have two programs I want to use renice to change their priority. The goal in this example is to make Parallels Desktop more responsive while I am rendering with Autodesk Maya in the background.
On my computer Maya currently has a PID of 952 and Parallels Desktop (prl_vm_app) has a PID of 951.
In the Terminal I am going to change Maya to have the lowest priority. This means Maya will still continue rendering but it won’t hog all of the computer’s CPU resources.
An interesting thing about using renice is that it will only slow down Maya’s CPU usage when there is contention for resources. If no other program wants access to the CPU, Maya will run at full speed.
To change Maya’s priority (PID 952) to the lowest setting I would type in:
sudo renice 20 952
Here a renice value of 20 sets Maya to have the lowest priority.
To change Parallels Desktop’s priority (PID 951) to the highest setting I would type in:
sudo renice -20 951
Here a renice value of -20 sets Parallels Desktop to have the highest priority.
One thing to keep in mind is that a LOWER renice value will increase the priority of the program and cause it to make increased use of the CPU. This seems backwards at first but this is how renice works.