MPSTAT(1)
๐ MPSTAT(1) โ the Linux User's Manual, but make it a group chat
okay bestie, sit down, hydrate, because we're about to talk about mpstat โ the processor-statistics girlie from the Linux User's Manual. she's giving โจmain character energyโจ and she has OPINIONS about your CPUs.
๐ธ NAME ๐ธ
mpstat โ report processors related statistics. that's it, that's the whole job. she watches your CPUs and tells you what they've been up to. nosy? yes. iconic? also yes. ๐
โจ SYNOPSIS โจ
mpstat [ -A ] [ --dec={ 0 | 1 | 2 } ] [ -H ] [ -n ] [ -U ] [ -u ] [ -T ]
[ -V ] [ -I { keyword[,...] | ALL } ] [ -N { node_list | ALL } ] [ -o
JSON ] [ -P { cpu_list | ALL } ] [ interval [ count ] ]
like, so many little flags. each one is a vibe. we'll get to all of them, don't worry ๐ซถ
๐ฆ DESCRIPTION ๐ฆ
mpstat writes to standard output the activities for each available processor, and processor 0 is the first one. yes, we start counting at zero, we're Unix, that's just how it is ๐
Global average activities among all processors are also reported, so you get the group-chat summary and the individual DMs.
She works on both SMP and UP machines โ but on a UP machine, only global average activities will be printed. so on UP she's like "okay there's one of you, here's the average, bye" ๐
If no activity has been selected, then the default report is the CPU utilization report.
Now, the parameters, bestie, listen up:
- the interval parameter specifies the amount of time in seconds between each report. a value of 0 (or no parameters at all) means processor statistics are reported for the time since system startup (boot). like, "since forever, babe."
- the count parameter can be specified in conjunction with the interval parameter if that one isn't set to zero. the value of count determines the number of reports generated at interval seconds apart.
- if the interval parameter is specified without the count parameter, the
mpstatcommand generates reports continuously. forever. no stopping. she will simply keep talking. ๐ญ
๐ OPTIONS ๐
-Aโ this option is equivalent to specifying-n -u -I ALL. it also implies specifying-N ALL -P ALLunless these options are explicitly set on the command line. it's the "give me everything" button. the girl who orders one of each.--dec={ 0 | 1 | 2 }โ specify the number of decimal places to use (0 to 2, default value is 2). pick your precision, diva. ๐-Hโ also detect and display statistics for physically hotplugged vCPUs. new CPU just dropped. ๐ฅ-I { keyword[,...] | ALL }โ report interrupts statistics. possible keywords areCPU,SCPU, andSUM.- with the
CPUkeyword, the number of each individual interrupt received per second by the CPU or CPUs is displayed. interrupts are those listed in/proc/interruptsfile. - with the
SCPUkeyword, the number of each individual software interrupt received per second by the CPU or CPUs is displayed. this option works only with kernels 2.6.31 and later. software interrupts are those listed in/proc/softirqsfile. - with the
SUMkeyword, thempstatcommand reports the total number of interrupts per processor. the following values are displayed:CPUโ processor number. the keywordallindicates that statistics are calculated as averages among all processors.intr/sโ show the total number of interrupts received per second by the CPU or CPUs.
- the
ALLkeyword is equivalent to specifying all the keywords above and therefore all the interrupts statistics are displayed. collect them all, pokรฉmon style ๐
- with the
-N { node_list | ALL }โ indicate the NUMA nodes for which statistics are to be reported. node_list is a list of comma-separated values or range of values (e.g.,0,2,4-7,12-). note that nodeallis the global average among all nodes. theALLkeyword indicates that statistics are to be reported for all nodes.-nโ report summary CPU statistics based on NUMA node placement. the following values are displayed:NODEโ logical NUMA node number. the keywordallindicates that statistics are calculated as averages among all nodes.- all the other fields are the same as those displayed with option
-u(see below). yes, scroll down. we get there.
-o JSONโ display the statistics in JSON (JavaScript Object Notation) format. JSON output field order is undefined, and new fields may be added in the future. so don't you dare hardcode a field order and then act surprised, bestie ๐-P { cpu_list | ALL }โ indicate the processors for which statistics are to be reported. cpu_list is a list of comma-separated values or range of values (e.g.,0,2,4-7,12-). note that processor 0 is the first processor, and processorallis the global average among all processors. theALLkeyword indicates that statistics are to be reported for all processors. offline processors are not displayed. they're not invited to the party ๐-Tโ display topology elements in the CPU report (see option-ubelow). the following elements are displayed:COREโ logical core number.SOCKโ logical socket number.NODEโ logical NUMA node number.
-Uโ display timestamp (UTC โ Coordinated Universal Time) in seconds from the epoch. raw, unixy, unbothered. โญ-uโ report CPU utilization. the following values are displayed:CPUโ processor number. the keywordallindicates 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.%gniceโ show the percentage of time spent by the CPU or CPUs to run a niced guest.%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.
-Vโ print version number then exit. short and sweet, she said what she said. ๐
๐ ENVIRONMENT ๐
the mpstat command takes into account the following environment variable:
S_COLORSโ by default statistics are displayed in color when the output is connected to a terminal. use this variable to change the settings. possible values for this variable arenever,alwaysorauto(the latter is equivalent to the default settings).
please note that the color (being red, yellow, or some other color) used to display a value is not indicative of any kind of issue simply because of the color. it only indicates different ranges of values. so no spiraling just because something's red, okay? it's just a range. breathe. ๐ซถ
S_COLORS_SGRโ specify the colors and other attributes used to display statistics on the terminal. its value is a colon-separated list of capabilities that defaults toI=32;22:N=34;1:W=35;1:X=31;1:Z=34;22. supported capabilities are:I=โ SGR (Select Graphic Rendition) substring for CPU number.N=โ SGR substring for non-zero statistics values.W=(orM=) โ SGR substring for percentage values in the range from 75% to 90% (or in the range 10% to 25% depending on the metric's meaning).X=(orH=) โ SGR substring for percentage values greater than or equal to 90% (or lower than or equal to 10% depending on the metric's meaning).Z=โ SGR substring for zero values.
S_TIME_FORMATโ if this variable exists and its value isISOthen the current locale will be ignored when printing the date in the report header. thempstatcommand will use the ISO 8601 format (YYYY-MM-DD) instead. the timestamp will also be compliant with ISO 8601 format. organized. punctual. a Virgo. ๐
๐ง EXAMPLES ๐ง
mpstat 2 5
display five reports of global statistics among all processors at two second intervals.
mpstat -P ALL 2 5
display five reports of statistics for all processors at two second intervals.
๐ BUGS ๐
/proc filesystem must be mounted for the mpstat command to work. no /proc, no vibes. that's the whole bug note. ๐ซถ
๐ FILES ๐
/proc contains various files with system statistics.
๐ AUTHOR ๐
Sebastien Godard (sysstat <at> orange.fr) โ the literal legend who made this whole thing happen. respect. ๐ซก
๐ SEE ALSO ๐
sar(1), pidstat(1), iostat(1), vmstat(8)
and that's the whole page, bestie ๐ this one shipped on Linux and it's dated JULY 2025 โ so go forth, run mpstat, and remember: the color being red means nothing, it's just a range. slay. โจ๐ฆ๐
๐ฆ where this page comes from
- alpine 3.24: sysstat-doc 12.7.8-r0 ยท GPL-2.0-or-later
- arch rolling: sysstat 12.8.0-1 ยท GPL-2.0-only
- fedora 43: sysstat 12.7.8-1.fc43 ยท GPL-2.0-or-later
- fedora 44: sysstat 12.7.9-2.fc44 ยท GPL-2.0-or-later
- nixpkgs unstable: sysstat 12.8.0
- (C) 2000-2025 Sebastien Godard (sysstat <at> orange.fr)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms