Changing process priority helps protect interactive work from batch jobs and keeps long-running background tasks from competing as aggressively for CPU time on the same Linux host. This is useful when backups, indexing jobs, compression tasks, or maintenance scripts need to keep running without taking precedence over more time-sensitive work.
On Linux, day-to-day process priority usually means the nice value used by the normal scheduler. nice starts a command with a chosen niceness, renice changes the niceness of an existing PID, and ps shows both the user-controlled NI column and the resulting PRI value.
Nice values range from -20 to 19, where a smaller number gives the process more urgency and a larger number makes it more polite to other workloads. This affects normal CPU scheduling rather than I/O priority or real-time scheduling classes, and lowering the nice value usually requires root privileges or an RLIMIT_NICE allowance.
$ ps -o pid,ni,pri,comm -p 186
PID NI PRI COMMAND
186 0 19 sleep
NI is the nice value that nice and renice change, while PRI is the scheduler priority currently shown by ps for the process.
$ nice -n 10 tar -cf backup.tar /srv/data
A positive nice value lowers urgency, so the command gives other runnable work more opportunity to use the CPU first.
$ renice --priority 5 --pid 186 186 (process ID) old priority 0, new priority 5
The value passed to renice –priority is the absolute nice value to apply to that PID.
$ ps -o pid,ni,pri,comm -p 186
PID NI PRI COMMAND
186 5 14 sleep
The NI column now shows 5, which confirms the process is less urgent than a default-priority task with nice value 0.
$ renice --priority -5 --pid 186 renice: failed to set priority for 186 (process ID): Permission denied
A smaller nice value raises urgency, so the command usually needs root or an RLIMIT_NICE allowance. Use
$ sudo renice --priority -5 --pid 186
only when the workload really needs higher urgency.