1MPSTAT(1) Linux User's Manual MPSTAT(1)
2
3
4
6 mpstat - Report processors related statistics.
7
8
10 mpstat [ -A ] [ --dec={ 0 | 1 | 2 } ] [ -H ] [ -n ] [ -u ] [ -T ] [ -V
11 ] [ -I { keyword[,...] | ALL } ] [ -N { node_list | ALL } ] [ -o JSON ]
12 [ -P { cpu_list | ALL } ] [ interval [ count ] ]
13
14
16 The mpstat command writes to standard output activities for each avail‐
17 able processor, processor 0 being the first one. Global average activ‐
18 ities among all processors are also reported. The mpstat command can
19 be used on both SMP and UP machines, but in the latter, only global av‐
20 erage activities will be printed. If no activity has been selected,
21 then the default report is the CPU utilization report.
22
23 The interval parameter specifies the amount of time in seconds between
24 each report. A value of 0 (or no parameters at all) indicates that
25 processors statistics are to be reported for the time since system
26 startup (boot). The count parameter can be specified in conjunction
27 with the interval parameter if this one is not set to zero. The value
28 of count determines the number of reports generated at interval seconds
29 apart. If the interval parameter is specified without the count parame‐
30 ter, the mpstat command generates reports continuously.
31
32
34 -A This option is equivalent to specifying -n -u -I ALL. This op‐
35 tion also implies specifying -N ALL -P ALL unless these options
36 are explicitly set on the command line.
37
38 --dec={ 0 | 1 | 2 }
39 Specify the number of decimal places to use (0 to 2, default
40 value is 2).
41
42 -H Also detect and display statistics for physically hotplugged vC‐
43 PUs.
44
45 -I { keyword[,...] | ALL }
46 Report interrupts statistics. Possible keywords are CPU, SCPU,
47 and SUM.
48
49 With the CPU keyword, the number of each individual interrupt
50 received per second by the CPU or CPUs is displayed. Interrupts
51 are those listed in /proc/interrupts file.
52
53 With the SCPU keyword, the number of each individual software
54 interrupt received per second by the CPU or CPUs is displayed.
55 This option works only with kernels 2.6.31 and later. Software
56 interrupts are those listed in /proc/softirqs file.
57
58 With the SUM keyword, the mpstat command reports the total num‐
59 ber of interrupts per processor. The following values are dis‐
60 played:
61
62
63 CPU Processor number. The keyword all indicates that statis‐
64 tics are calculated as averages among all processors.
65
66
67 intr/s Show the total number of interrupts received per second
68 by the CPU or CPUs.
69
70 The ALL keyword is equivalent to specifying all the keywords
71 above and therefore all the interrupts statistics are displayed.
72
73 -N { node_list | ALL }
74 Indicate the NUMA nodes for which statistics are to be reported.
75 node_list is a list of comma-separated values or range of values
76 (e.g., 0,2,4-7,12-). Note that node all is the global average
77 among all nodes. The ALL keyword indicates that statistics are
78 to be reported for all nodes.
79
80 -n Report summary CPU statistics based on NUMA node placement. The
81 following values are displayed:
82
83 NODE Logical NUMA node number. The keyword all indicates that
84 statistics are calculated as averages among all nodes.
85
86 All the other fields are the same as those displayed with option
87 -u (see below).
88
89 -o JSON
90 Display the statistics in JSON (JavaScript Object Notation) for‐
91 mat. JSON output field order is undefined, and new fields may
92 be added in the future.
93
94 -P { cpu_list | ALL }
95 Indicate the processors for which statistics are to be reported.
96 cpu_list is a list of comma-separated values or range of values
97 (e.g., 0,2,4-7,12-). Note that processor 0 is the first proces‐
98 sor, and processor all is the global average among all proces‐
99 sors. The ALL keyword indicates that statistics are to be re‐
100 ported for all processors. Offline processors are not dis‐
101 played.
102
103 -T Display topology elements in the CPU report (see option -u be‐
104 low). The following elements are displayed:
105
106 CORE Logical core number.
107
108 SOCK Logical socket number.
109
110 NODE Logical NUMA node number.
111
112 -u Report CPU utilization. The following values are displayed:
113
114 CPU Processor number. The keyword all indicates that statis‐
115 tics are calculated as averages among all processors.
116
117 %usr Show the percentage of CPU utilization that occurred
118 while executing at the user level (application).
119
120 %nice Show the percentage of CPU utilization that occurred
121 while executing at the user level with nice priority.
122
123 %sys Show the percentage of CPU utilization that occurred
124 while executing at the system level (kernel). Note that
125 this does not include time spent servicing hardware and
126 software interrupts.
127
128 %iowait
129 Show the percentage of time that the CPU or CPUs were
130 idle during which the system had an outstanding disk I/O
131 request.
132
133 %irq Show the percentage of time spent by the CPU or CPUs to
134 service hardware interrupts.
135
136 %soft Show the percentage of time spent by the CPU or CPUs to
137 service software interrupts.
138
139 %steal Show the percentage of time spent in involuntary wait by
140 the virtual CPU or CPUs while the hypervisor was servic‐
141 ing another virtual processor.
142
143 %guest Show the percentage of time spent by the CPU or CPUs to
144 run a virtual processor.
145
146 %gnice Show the percentage of time spent by the CPU or CPUs to
147 run a niced guest.
148
149 %idle Show the percentage of time that the CPU or CPUs were
150 idle and the system did not have an outstanding disk I/O
151 request.
152
153 -V Print version number then exit.
154
155
157 The mpstat command takes into account the following environment vari‐
158 able:
159
160 S_COLORS
161 By default statistics are displayed in color when the output is
162 connected to a terminal. Use this variable to change the set‐
163 tings. Possible values for this variable are never, always or
164 auto (the latter is equivalent to the default settings).
165 Please note that the color (being red, yellow, or some other
166 color) used to display a value is not indicative of any kind of
167 issue simply because of the color. It only indicates different
168 ranges of values.
169
170 S_COLORS_SGR
171 Specify the colors and other attributes used to display statis‐
172 tics on the terminal. Its value is a colon-separated list of
173 capabilities that defaults to
174 I=32;22:N=34;1:W=35;1:X=31;1:Z=34;22. Supported capabilities
175 are:
176
177 I= SGR (Select Graphic Rendition) substring for CPU number.
178
179 N= SGR substring for non-zero statistics values.
180
181 W= (or M=)
182 SGR substring for percentage values in the range from 75%
183 to 90% (or in the range 10% to 25% depending on the met‐
184 ric's meaning).
185
186 X= (or H=)
187 SGR substring for percentage values greater than or equal
188 to 90% (or lower than or equal to 10% depending on the
189 metric's meaning).
190
191 Z= SGR substring for zero values.
192
193 S_TIME_FORMAT
194 If this variable exists and its value is ISO then the current
195 locale will be ignored when printing the date in the report
196 header. The mpstat command will use the ISO 8601 format (YYYY-
197 MM-DD) instead. The timestamp will also be compliant with ISO
198 8601 format.
199
200
202 mpstat 2 5
203 Display five reports of global statistics among all processors
204 at two second intervals.
205
206 mpstat -P ALL 2 5
207 Display five reports of statistics for all processors at two
208 second intervals.
209
210
212 /proc filesystem must be mounted for the mpstat command to work.
213
214
216 /proc contains various files with system statistics.
217
218
220 Sebastien Godard (sysstat <at> orange.fr)
221
222
224 sar(1), pidstat(1), iostat(1), vmstat(8)
225
226 https://github.com/sysstat/sysstat
227
228
229
230Linux MAY 2023 MPSTAT(1)