Linux renice Command: Change the Priority of a Running Process
renice changes the nice value of a process that is already running. When batch jobs use a lot of CPU and affect other tasks, you can check the target PID and adjust it accordingly.
What is the renice command?
The larger the nice value, the lower the CPU priority generally is. This command only relates to CPU scheduling and does not reduce memory usage or the process itself. Lowering the value to increase priority may require administrator privileges or special limits.
Basic syntax
renice -n priority -p PID...
The installed implementation and options may vary depending on the distribution. Check your current system's description with man renice.
Examples
Checking the current nice value
First, confirm that the target PID and command are correct.
ps -p 1234 -o pid,user,ni,cmd
Adjusting a running process
Set the nice value of the current process to 10.
renice -n 10 -p 1234
Check the results again
Check the actual NI column after the change.
ps -p 1234 -o pid,ni,cmd
Check the value change of a running process
renice changes the nice value of an already running process. Replace PID with the actual PID of the test process, and check before and after the change using ps.
ps -o pid,ni,comm -p PID renice -n 10 -p PID ps -o pid,ni,comm -p PID
For example, the NI column in the last check changes from 0 to 10. The message format of renice itself may vary depending on the implementation.
Lowering the value to increase priority usually requires additional privileges. Even if the value is changed to address CPU issues, you should also check for bottlenecks or disk/memory wait times. Make sure to verify the target information right before execution to avoid acting on a PID that has already ended or been reused.
Main Options and Format
| Options/Format | Description |
|---|---|
-n value |
Specify the nice priority to set. |
-p PID |
Select the target by process ID. |
-u user |
Select processes that belong to the user. The range is wide, so caution is needed. |
-g group |
Select the process group as the target. |
Precautions when using
Since PIDs can be reused, check the command and owner again with ps just before adjusting. renice -u can affect multiple processes of the user. Lowering the nice value requires permission, and even if the adjustment is successful, other CPU resource limits or cgroup policies may take priority.
Frequently Asked Questions
What is the difference between nice and renice?
nice adjusts the priority when starting a new command, while renice changes the nice value of a process that is already running.
Official Documentation
You can check the exact behavior of the options and implementation-specific differences in the official documentation about renice.









