change linux process priority with nice and renice


2009-12-03 Digg! icurtain Delcious icurtain

Process priorities are set between 20 (lowest) and -19 (highest)

To launch a task with a priority of 5 try:
mike@mikebox:~$ sudo nice task 5

If you're laptop is overehating and kacpi_notify is stealing all your CPU power polling the CPU temperature you can use renice to change priority of a running process (pid 20) to priority 5
mike@mikebox:~$ sudo renice 5 -p 20

renice Usage:
renice [-n] priority [-p|--pid] pid [... pid]
renice [-n] priority -g|--pgrp pgrp [... pgrp]
renice [-n] priority -u|--user user [... user]
renice -h | --help
renice -v | --version


nice Usage: nice [OPTION] [COMMAND [ARG]...]
Run COMMAND with an adjusted niceness, which affects process scheduling.
With no COMMAND, print the current niceness. Nicenesses range from
-20 (most favourable scheduling) to 19 (least favourable).

-n, --adjustment=N add integer N to the niceness (default 10)
--help display this help and exit
--version output version information and exit