Skip to main content
Not all processes are equally important. If a CPU-heavy process consumes all CPU time, it can slow down critical services. Process priority (niceness) lets you influence how much CPU time a process receives relative to others. In this article we explain how the Linux scheduler uses niceness values, how to view and change them, and demonstrate common commands to adjust priorities safely. What you will learn
  • What niceness means and how the scheduler uses it
  • The niceness value range and semantics
  • How to view processes and their niceness
  • How to change niceness for running and new processes
How Linux uses niceness Linux attempts to distribute CPU time fairly across processes. The scheduler uses the niceness (nice) value as a bias when deciding how frequently to run each process.
  • Lower nice values → higher priority (scheduled more often).
  • Highest priority: -20
  • Lowest priority: 19
The scheduler factors in the nice value when allocating CPU slices; changing a process’s nice value changes how the scheduler prioritizes it.
A dark-themed dashboard titled "Process Priority" with four vertical bar indicators: two short cyan bars labeled "Level −20 runs" and "Priority Lowest" and two tall cyan bars labeled "Priority Highest" and "Level 19 runs."
Root vs. regular user privileges Only the root user (or a process granted the CAP_SYS_NICE capability) can assign a negative niceness (increase priority) or reduce the niceness of an existing process. Unprivileged users may only increase the niceness of their own processes (make them “nicer” to others), which lowers their priority.
A slide titled "Process Priority" comparing Root User and Normal User permissions: the root user can set and lower nice values (including negative) and both increase or decrease priorities, while a normal user cannot start or reduce processes with negative nice and can only increase nice values.
Only root (or a user/process granted the CAP_SYS_NICE capability) can assign negative niceness or make a process less “nice” (i.e., lower the nice value and increase priority). Regular users can only make their own processes nicer (increase the nice value).
Practical demo — view and change niceness The following steps show how to start a CPU-bound process, inspect its niceness with top and ps, and change it with renice or by starting a process with nice.
  1. Start a CPU-intensive process in the background (example uses sha1sum reading from /dev/zero):
  1. Inspect processes with top. While top is running you can press r to renice a process interactively; top will prompt for a PID:
  1. Change niceness using renice. For example, set PID 6258 to niceness 12:
  • Increasing the niceness (higher number) lowers the process priority.
  • Decreasing niceness (smaller or negative number) raises priority.
  1. Start a new process with a specified niceness using nice -n N. Example: start a sleep process with niceness 14 and verify with ps:
Quick reference — commands Niceness levels summary Best practices and notes
  • Use niceness to lower CPU priority for non-critical, CPU-bound background tasks (e.g., backups, batch jobs) so interactive services remain responsive.
  • Avoid giving lots of processes negative niceness unless necessary; increasing overall system responsiveness via careful resource planning is preferable.
  • Only root (or a process with CAP_SYS_NICE) can assign negative niceness — consider using sudo if you must raise priority.
See also Summary
  • Niceness ranges from -20 (highest priority) to 19 (lowest priority).
  • Lower niceness value means higher CPU scheduling priority.
  • Root can set negative niceness or reduce niceness for processes; regular users can only increase niceness of their own processes.

Watch Video