Home nice: The Command That Asks Your Process to Please Calm Down

    nice: The Command That Asks Your Process to Please Calm Down

    0
    7
    blank

    Unix processes have a “niceness” value ranging from -20 (maximum priority, aggressive) to 19 (minimum priority, pathologically polite), which hints to the scheduler how much CPU time they should receive relative to others. Running a process with nice bumps its niceness up — making it yield to other processes — while renice adjusts a running process after the fact. Only root can set negative niceness values, on the logic that demanding more than your share of the CPU is a privilege requiring administrative authority. The naming convention — higher niceness meaning lower priority, the nicest processes getting the least — is counterintuitive enough to catch out everyone at least once. The underlying concept, that batch jobs should yield to interactive ones, predates Unix entirely and remains as relevant as ever on systems that simultaneously run interactive shells and runaway machine learning jobs.