$linuxjunkies
>

nice value

also: priority, NI

A numeric priority level (-20 to 19) that controls how much CPU time a process receives relative to others; lower values get higher priority.

The nice value is a kernel scheduling parameter that affects process priority on Unix-like systems. It ranges from -20 (highest priority) to 19 (lowest priority), with a default of 0. The name comes from the idea of being "nice" to other processes by voluntarily using less CPU time.

When the system is busy, the kernel scheduler allocates CPU time based on nice values. A process with nice value -10 will receive more CPU time than a process with nice value 10. This allows you to prioritize important tasks or deprioritize background jobs without using hard resource limits.

You can view a process's nice value using ps or top, and change it with the nice command when starting a process, or with renice to adjust a running process. For example: nice -n 5 long_backup_script.sh runs the script at a lower priority.

Related terms