Glossary

nice

A process's nice value biases how the scheduler prioritises it. The range is -20 (least nice, highest priority) to +19 (nicest, lowest priority), with a default of 0. A "nice" process yields CPU time to others more readily; a process with negative nice gets more CPU than its share. Only root can lower (more negative) a process's nice value; users can only make their own processes nicer.

nice -n 10 long-running-command          # start with nice +10
renice 15 -p 1234                         # adjust a running process
renice 15 -u alice                        # all of alice's processes
ionice -c 3 cp big.iso /mnt/              # idle I/O priority

Nice was invented before modern schedulers and is a coarse, simple knob, but it remains useful for background work that should not interfere with interactive tasks: compilers, video encoders, backups, and scientific batch jobs. For I/O rather than CPU contention, ionice provides the analogous control over block-device priority.

On multi-tenant systems, cgroups provide a much more powerful way to apportion CPU, memory, and I/O between groups of processes, and have largely superseded nice for serious resource control. Systemd's slice-and-scope machinery is built on cgroups for exactly this reason.

Related terms: renice, cgroup, ionice

Discussed in:

Also defined in: Textbook of Linux