Linux / DevOps · Flashcard

What does lowering a process's nice value actually change?

  • AIts relative weight when competing for CPU, which only matters while cores are contended
  • BIts reserved share of CPU time, which the scheduler guarantees whatever else is running
  • CIts maximum runtime per scheduling period, after which it is stopped until the next one
  • DIts placement priority, so the scheduler prefers cores that are currently unoccupied

Why this is the answer

nice sets a proportional weight, so a favoured task gets a larger slice only when something else wants the CPU at the same time; on an idle machine it changes nothing. Confusing weight with a guarantee is the common error — the scheduler makes no reservation, and a niced-down task can still get plenty of CPU when the system is quiet. A hard runtime cap per period is cgroup bandwidth control via cpu.max, a different mechanism. And core placement is decided by load balancing and affinity, not by the nice value.

Official docs
Study in Gnoseed →