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