Jump to Navigation

216 - How to use mpstat

The mpstat command writes to standard output activities for each available processor, processor 0 being the first one. Global average activities
among all processors are also reported. The mpstat command can be used both on SMP and UP machines, but in the latter, only global average
activities will be printed. If no activity has been selected, then the default report is the CPU utilization report.

mpstat [ -P { cpu | ALL } ] [ -V ] [ interval [ count ] ]

-P : cpu number(0, 1, ...) or ALL
-V : Version Number

# mpstat

# mpstat -P ALL

# mpstat -P 0

# mpstat 5 3
(every 5 minutes , 3 outputs)

CPU
Processor number. The keyword all indicates that statistics are calculated as averages among all processors.

%usr
Show the percentage of CPU utilization that occurred while executing at the user level (application).

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

%sys
Show the percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this does not include time spent servicing hardware and software interrupts.

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

%irq
Show the percentage of time spent by the CPU or CPUs to service hardware interrupts.

%soft
Show the percentage of time spent by the CPU or CPUs to service software interrupts.

%steal
Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.

%guest
Show the percentage of time spent by the CPU or CPUs to run a virtual processor.

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

 

Linux:


Main menu 2

Story | by Dr. Radut