56

On Ubuntu server load graphs I see 4 types of CPU consumption: User, System, Nice and Idle.

What does Nice type mean?

1
  • We fixed high nice% on one of our Dell RedHat servers by disabling PowerNow in the BIOS. Nice went from 45% to 10%. Reboot required of course.
    – user180166
    Jul 3, 2013 at 11:59

4 Answers 4

23

It is the CPU scheduling priority, higher vales (+19) mean lower priority, and lower values (-20) mean higher priority (inverse relationship). man 2 getpriority will give you lots of details. You can set the nice value when launching a process with the nice command and then change it with the renice command. Only the superuser (root) can specify a priority increase of a process.

1
  • 77
    This explicates what nice means but not what the "nice CPU time" in top means. Feb 19, 2014 at 3:25
124

On a CPU utilization graph or report, the "nice" CPU percentage is the % of CPU time occupied by user level processes with a positive nice value (lower scheduling priority -- see man nice for details).

Basically it's CPU time that's currently "in use", but if a normal (nice value 0) or high-priority (negative nice value) process comes along those programs will be kicked off the CPU.

2
  • I upvoted, but correct me if I'm wrong: I got this from man 1 iostat `` %nice: Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.``. It seem not CPU time. Dec 2, 2013 at 15:44
  • 5
    @HVNSweeting "time" in the "time sharing system" ("scheduler time") sense, not the "hands moving on the clock on the wall" sense. Over a long enough duration at steady state they're roughly equivalent: A machine that's up for 3 years with a steady-state CPU utilization will accumulate roughly that percentage of its wall-clock uptime in the appropriate buckets. The number of seconds is a less useful metric than "scheduler time" (% of a given number of cycles spent in each bucket) though.
    – voretaq7
    Dec 2, 2013 at 21:35
31

%user: Percentage of CPU utilization that occurred while executing at the user level (application).

%nice: Percentage of CPU utilization that occurred while executing at the user level with nice priority.

%system: Percentage of CPU utilization that occurred while executing at the system level (kernel).

%iowait: Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.

%idle: Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.

Source: http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html

See also man mpstat.

1
  • 1
    Just a fact: idle time is generally measured by the cpu running a special task with the highest nice value possible (+19, lowest priority)
    – ccov77
    Sep 17, 2023 at 22:30
8

Nice is intended for batch or background jobs. Jobs are niced (given lower scheduling priority) so they don't use CPU when online users need it. The nice and renice programs set the nice priority. Negative nice priorities are bad (real-time).

If you have low idle time but a lot of nice time, then you are likely running a background process like Seti at Home or something else similar.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .