49

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

What does Nice type mean?

Niro
  • 1,371
  • 3
  • 17
  • 35
  • 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. –  Jul 03 '13 at 11:59

4 Answers4

114

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.

Cristian Ciupitu
  • 6,226
  • 2
  • 41
  • 55
voretaq7
  • 79,345
  • 17
  • 128
  • 213
  • 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. – HVNSweeting Dec 02 '13 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 02 '13 at 21:35
29

%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.

Cristian Ciupitu
  • 6,226
  • 2
  • 41
  • 55
Daniel W.
  • 1,439
  • 4
  • 23
  • 46
20

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.

Cristian Ciupitu
  • 6,226
  • 2
  • 41
  • 55
Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
6

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.

Nathan
  • 157
  • 7
BillThor
  • 27,354
  • 3
  • 35
  • 69