1MPSTAT(1)                     Linux User's Manual                    MPSTAT(1)
2
3
4

NAME

6       mpstat - Report processors related statistics.
7

SYNOPSIS

9       mpstat  [ -A ] [ --dec={ 0 | 1 | 2 } ] [ -n ] [ -u ] [ -T ] [ -V ] [ -I
10       { keyword [,...] | ALL } ] [ -N { node_list | ALL } ] [ -o JSON ] [  -P
11       { cpu_list | ALL } ] [ interval [ count ] ]
12

DESCRIPTION

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

OPTIONS

32       -A     This  option  is  equivalent  to  specifying -n -u -I ALL.  This
33              option also implies  specifying  -N  ALL  -P  ALL  unless  these
34              options are explicitly set on the command line.
35
36       --dec={ 0 | 1 | 2 }
37              Specify  the  number  of  decimal places to use (0 to 2, default
38              value is 2).
39
40       -I { keyword [,...] | ALL }
41              Report interrupts statistics.
42
43              Possible keywords are CPU, SCPU, and SUM.
44
45              With the CPU keyword, the number of  each  individual  interrupt
46              received  per second by the CPU or CPUs is displayed. Interrupts
47              are those listed in /proc/interrupts file.
48
49              With the SCPU keyword, the number of  each  individual  software
50              interrupt  received  per second by the CPU or CPUs is displayed.
51              This option works only with kernels 2.6.31 and  later.  Software
52              interrupts are those listed in /proc/softirqs file.
53
54              With  the SUM keyword, the mpstat command reports the total num‐
55              ber of interrupts per processor.  The following values are  dis‐
56              played:
57
58              CPU
59                     Processor  number. The keyword all indicates that statis‐
60                     tics are calculated as averages among all processors.
61
62              intr/s
63                     Show the total number of interrupts received  per  second
64                     by the CPU or CPUs.
65
66              The  ALL  keyword  is  equivalent to specifying all the keywords
67              above and therefore all the interrupts statistics are displayed.
68
69       -N { node_list | ALL }
70              Indicate the NUMA nodes for which statistics are to be reported.
71              node_list is a list of comma-separated values or range of values
72              (e.g., 0,2,4-7,12-).  Note that node all is the  global  average
73              among  all  nodes. The ALL keyword indicates that statistics are
74              to be reported for all nodes.
75
76       -n     Report summary CPU statistics based on NUMA node placement.  The
77              following values are displayed:
78
79              NODE
80                     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
97              reported for all processors.  Offline processors  are  not  dis‐
98              played.
99
100       -T     Display  topology  elements  in  the  CPU  report (see option -u
101              below). The following elements are displayed:
102
103              CORE
104                     Logical core number.
105
106              SOCK
107                     Logical socket number.
108
109              NODE
110                     Logical NUMA node number.
111
112       -u     Report CPU utilization. The following values are displayed:
113
114              CPU
115                     Processor number. The keyword all indicates that  statis‐
116                     tics are calculated as averages among all processors.
117
118              %usr
119                     Show  the  percentage  of  CPU  utilization that occurred
120                     while executing at the user level (application).
121
122              %nice
123                     Show the percentage  of  CPU  utilization  that  occurred
124                     while executing at the user level with nice priority.
125
126              %sys
127                     Show  the  percentage  of  CPU  utilization that occurred
128                     while executing at the system level (kernel).  Note  that
129                     this  does  not include time spent servicing hardware and
130                     software interrupts.
131
132              %iowait
133                     Show the percentage of time that the  CPU  or  CPUs  were
134                     idle  during which the system had an outstanding disk I/O
135                     request.
136
137              %irq
138                     Show the percentage of time spent by the CPU or  CPUs  to
139                     service hardware interrupts.
140
141              %soft
142                     Show  the  percentage of time spent by the CPU or CPUs to
143                     service software interrupts.
144
145              %steal
146                     Show the percentage of time spent in involuntary wait  by
147                     the  virtual CPU or CPUs while the hypervisor was servic‐
148                     ing another virtual processor.
149
150              %guest
151                     Show the percentage of time spent by the CPU or  CPUs  to
152                     run a virtual processor.
153
154              %gnice
155                     Show  the  percentage of time spent by the CPU or CPUs to
156                     run a niced guest.
157
158              %idle
159                     Show the percentage of time that the  CPU  or  CPUs  were
160                     idle  and the system did not have an outstanding disk I/O
161                     request.
162
163       -V     Print version number then exit.
164
165

ENVIRONMENT

167       The mpstat command takes into account the following  environment  vari‐
168       able:
169
170
171       S_COLORS
172              When  this  variable  is set, display statistics in color on the
173              terminal.  Possible values for this variable are  never,  always
174              or auto (the latter is the default).
175
176              Please  note  that  the  color (being red, yellow, or some other
177              color) used to display a value is not indicative of any kind  of
178              issue  simply  because of the color. It only indicates different
179              ranges of values.
180
181
182       S_COLORS_SGR
183              Specify the colors and other attributes used to display  statis‐
184              tics  on  the  terminal.  Its value is a colon-separated list of
185              capabilities            that             defaults             to
186              H=31;1:I=32;22:M=35;1:N=34;1:Z=34;22.    Supported  capabilities
187              are:
188
189
190              H=     SGR (Select Graphic Rendition) substring  for  percentage
191                     values greater than or equal to 75%.
192
193
194              I=     SGR substring for CPU number.
195
196
197              M=     SGR substring for percentage values in the range from 50%
198                     to 75%.
199
200
201              N=     SGR substring for non-zero statistics values.
202
203
204              Z=     SGR substring for zero values.
205
206
207       S_TIME_FORMAT
208              If this variable exists and its value is ISO  then  the  current
209              locale  will  be  ignored  when  printing the date in the report
210              header.  The mpstat command will use the ISO 8601 format  (YYYY-
211              MM-DD)  instead.   The timestamp will also be compliant with ISO
212              8601 format.
213
214

EXAMPLES

216       mpstat 2 5
217              Display five reports of global statistics among  all  processors
218              at two second intervals.
219
220       mpstat -P ALL 2 5
221              Display  five  reports  of  statistics for all processors at two
222              second intervals.
223
224

BUGS

226       /proc filesystem must be mounted for the mpstat command to work.
227
228

FILES

230       /proc contains various files with system statistics.
231
232

AUTHOR

234       Sebastien Godard (sysstat <at> orange.fr)
235

SEE ALSO

237       sar(1), pidstat(1), iostat(1), vmstat(8)
238
239       https://github.com/sysstat/sysstat
240
241       http://pagesperso-orange.fr/sebastien.godard/
242
243
244
245Linux                            NOVEMBER 2019                       MPSTAT(1)
Impressum