LinuxCommandLibrary

mpstat

TLDR

Display CPU statistics every 2 seconds

$ mpstat 2
copy
Display 5 reports at 2-second intervals
$ mpstat 2 5
copy
Display statistics for specific processor
$ mpstat -P 0 2 5
copy
Display statistics for all processors
$ mpstat -P ALL 2
copy
Display with interrupts per processor
$ mpstat -I ALL 2
copy

SYNOPSIS

mpstat [options] [interval [count]]

DESCRIPTION

mpstat reports processor-related statistics including CPU utilization, interrupts, and other per-processor metrics. It can display statistics for individual processors or aggregated across all.

PARAMETERS

-A

Equivalent to -n -u -I ALL -P ALL
-I {SUM|CPU|SCPU|ALL}
Report interrupt statistics
-n
Report NUMA node placement statistics
-o JSON
Output in JSON format
-P {processor|ALL}
Indicate processor number or ALL
-u
Report CPU utilization (default)
-V
Print version number

OUTPUT FIELDS

%usr: User level (applications)
%nice: User level with nice priority
%sys: System level (kernel)
%iowait: Waiting for I/O
%irq: Hardware interrupts
%soft: Software interrupts
%steal: Stolen by hypervisor
%guest: Running virtual processor
%gnice: Running niced guest
%idle: Idle time

CAVEATS

The first report shows statistics since boot. Processor numbering starts at 0. On virtual machines, %steal indicates CPU time taken by the hypervisor.

HISTORY

mpstat is part of the sysstat package, providing multiprocessor statistics for SMP systems.

SEE ALSO

sar(1), iostat(1), vmstat(8), top(1)

> TERMINAL_GEAR

Curated for the Linux community

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99