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