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

NAME

6       iostat - Report Central Processing Unit (CPU) statistics and input/out‐
7       put statistics for devices and partitions.
8

SYNOPSIS

10       iostat [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V  ]  [
11       -x  ]  [ -y ] [ -z ] [ --dec={ 0 | 1 | 2 } ] [ -j { ID | LABEL | PATH |
12       UUID | ... } ] [ -o JSON ] [ [ -H ] -g group_name ] [ --human ] [ -p  [
13       device [,...] | ALL ] ] [ device [...] | ALL ] [ interval [ count ] ]
14

DESCRIPTION

16       The  iostat  command  is used for monitoring system input/output device
17       loading by observing the time the devices are  active  in  relation  to
18       their average transfer rates. The iostat command generates reports that
19       can be used to  change  system  configuration  to  better  balance  the
20       input/output load between physical disks.
21
22       The  first  report  generated by the iostat command provides statistics
23       concerning the time since the system was booted, unless the  -y  option
24       is  used (in this case, this first report is omitted).  Each subsequent
25       report covers the time since the previous report.  All  statistics  are
26       reported  each time the iostat command is run. The report consists of a
27       CPU header row followed by a row of CPU statistics.  On  multiprocessor
28       systems,  CPU  statistics  are calculated system-wide as averages among
29       all processors. A device header row is displayed followed by a line  of
30       statistics for each device that is configured.
31
32       The  interval parameter specifies the amount of time in seconds between
33       each report. The count parameter can be specified in  conjunction  with
34       the  interval parameter. If the count parameter is specified, the value
35       of count determines the number of reports generated at interval seconds
36       apart. If the interval parameter is specified without the count parame‐
37       ter, the iostat command generates reports continuously.
38
39

REPORTS

41       The iostat command generates two types of reports, the CPU  Utilization
42       report and the Device Utilization report.
43
44       CPU Utilization Report
45              The first report generated by the iostat command is the CPU Uti‐
46              lization Report. For multiprocessor systems, the CPU values  are
47              global  averages  among all processors.  The report has the fol‐
48              lowing format:
49
50              %user
51                     Show the percentage  of  CPU  utilization  that  occurred
52                     while executing at the user level (application).
53
54              %nice
55                     Show  the  percentage  of  CPU  utilization that occurred
56                     while executing at the user level with nice priority.
57
58              %system
59                     Show the percentage  of  CPU  utilization  that  occurred
60                     while executing at the system level (kernel).
61
62              %iowait
63                     Show  the  percentage  of  time that the CPU or CPUs were
64                     idle during which the system had an outstanding disk  I/O
65                     request.
66
67              %steal
68                     Show  the percentage of time spent in involuntary wait by
69                     the virtual CPU or CPUs while the hypervisor was  servic‐
70                     ing another virtual processor.
71
72              %idle
73                     Show  the  percentage  of  time that the CPU or CPUs were
74                     idle and the system did not have an outstanding disk  I/O
75                     request.
76
77       Device Utilization Report
78              The  second report generated by the iostat command is the Device
79              Utilization Report. The device report provides statistics  on  a
80              per physical device or partition basis. Block devices and parti‐
81              tions for which statistics are to be displayed may be entered on
82              the  command  line.  If no device nor partition is entered, then
83              statistics are displayed for every device used  by  the  system,
84              and  providing  that the kernel maintains statistics for it.  If
85              the ALL keyword is given on the command  line,  then  statistics
86              are  displayed for every device defined by the system, including
87              those that have never been used.  Transfer rates are shown in 1K
88              blocks  by default, unless the environment variable POSIXLY_COR‐
89              RECT is set, in which case 512-byte blocks are used.  The report
90              may show the following fields, depending on the flags used:
91
92              Device:
93                     This  column  gives  the  device  (or  partition) name as
94                     listed in the /dev directory.
95
96              tps
97                     Indicate the number of transfers  per  second  that  were
98                     issued to the device. A transfer is an I/O request to the
99                     device. Multiple logical requests can be combined into  a
100                     single  I/O request to the device. A transfer is of inde‐
101                     terminate size.
102
103              Blk_read/s (kB_read/s, MB_read/s)
104                     Indicate  the  amount  of  data  read  from  the   device
105                     expressed  in  a  number of blocks (kilobytes, megabytes)
106                     per second. Blocks are equivalent to sectors  and  there‐
107                     fore have a size of 512 bytes.
108
109              Blk_wrtn/s (kB_wrtn/s, MB_wrtn/s)
110                     Indicate  the  amount  of  data  written  to  the  device
111                     expressed in a number of  blocks  (kilobytes,  megabytes)
112                     per second.
113
114              Blk_dscd/s (kB_dscd/s, MB_dscd/s)
115                     Indicate  the  amount  of  data  discarded for the device
116                     expressed in a number of  blocks  (kilobytes,  megabytes)
117                     per second.
118
119              Blk_read (kB_read, MB_read)
120                     The total number of blocks (kilobytes, megabytes) read.
121
122              Blk_wrtn (kB_wrtn, MB_wrtn)
123                     The  total  number of blocks (kilobytes, megabytes) writ‐
124                     ten.
125
126              Blk_dscd (kB_dscd, MB_dscd)
127                     The total number of blocks  (kilobytes,  megabytes)  dis‐
128                     carded.
129
130              r/s
131                     The  number (after merges) of read requests completed per
132                     second for the device.
133
134              w/s
135                     The number (after merges) of write requests completed per
136                     second for the device.
137
138              d/s
139                     The  number  (after merges) of discard requests completed
140                     per second for the device.
141
142              f/s
143                     The number (after merges) of flush requests completed per
144                     second  for  the device.  This counts flush requests exe‐
145                     cuted by disks. Flush requests are not tracked for parti‐
146                     tions.  Before being merged, flush operations are counted
147                     as writes.
148
149              sec/s (kB/s, MB/s)
150                     The number of sectors (kilobytes, megabytes)  read  from,
151                     written to or discarded for the device per second.
152
153              rsec/s (rkB/s, rMB/s)
154                     The  number  of  sectors (kilobytes, megabytes) read from
155                     the device per second.
156
157              wsec/s (wkB/s, wMB/s)
158                     The number of sectors (kilobytes, megabytes)  written  to
159                     the device per second.
160
161              dsec/s (dkB/s, dMB/s)
162                     The  number  of  sectors (kilobytes, megabytes) discarded
163                     for the device per second.
164
165              rqm/s
166                     The number of I/O requests merged per  second  that  were
167                     queued to the device.
168
169              rrqm/s
170                     The  number  of read requests merged per second that were
171                     queued to the device.
172
173              wrqm/s
174                     The number of write requests merged per second that  were
175                     queued to the device.
176
177              drqm/s
178                     The  number  of  discard  requests merged per second that
179                     were queued to the device.
180
181              %rrqm
182                     The percentage of read requests  merged  together  before
183                     being sent to the device.
184
185              %wrqm
186                     The  percentage  of write requests merged together before
187                     being sent to the device.
188
189              %drqm
190                     The percentage of discard requests merged together before
191                     being sent to the device.
192
193              areq-sz
194                     The  average size (in kilobytes) of the I/O requests that
195                     were issued to the device.
196                     Note: In previous  versions,  this  field  was  known  as
197                     avgrq-sz and was expressed in sectors.
198
199              rareq-sz
200                     The average size (in kilobytes) of the read requests that
201                     were issued to the device.
202
203              wareq-sz
204                     The average size (in kilobytes)  of  the  write  requests
205                     that were issued to the device.
206
207              dareq-sz
208                     The  average  size (in kilobytes) of the discard requests
209                     that were issued to the device.
210
211              await
212                     The average  time  (in  milliseconds)  for  I/O  requests
213                     issued to the device to be served. This includes the time
214                     spent by the requests in queue and the time spent servic‐
215                     ing them.
216
217              r_await
218                     The  average  time  (in  milliseconds)  for read requests
219                     issued to the device to be served. This includes the time
220                     spent by the requests in queue and the time spent servic‐
221                     ing them.
222
223              w_await
224                     The average time (in  milliseconds)  for  write  requests
225                     issued to the device to be served. This includes the time
226                     spent by the requests in queue and the time spent servic‐
227                     ing them.
228
229              d_await
230                     The  average  time (in milliseconds) for discard requests
231                     issued to the device to be served. This includes the time
232                     spent by the requests in queue and the time spent servic‐
233                     ing them.
234
235              f_await
236                     The average time (in  milliseconds)  for  flush  requests
237                     issued  to the device to be served.  The block layer com‐
238                     bines flush requests and executes at most one at a  time.
239                     Thus  flush  operations  could be twice as long: Wait for
240                     current flush request, then execute it, then wait for the
241                     next one.
242
243              aqu-sz
244                     The average queue length of the requests that were issued
245                     to the device.
246                     Note: In previous  versions,  this  field  was  known  as
247                     avgqu-sz.
248
249              %util
250                     Percentage of elapsed time during which I/O requests were
251                     issued to  the  device  (bandwidth  utilization  for  the
252                     device).  Device  saturation  occurs  when  this value is
253                     close to 100% for devices serving requests serially.  But
254                     for  devices  serving  requests in parallel, such as RAID
255                     arrays and modern SSDs,  this  number  does  not  reflect
256                     their performance limits.
257

OPTIONS

259       -c     Display the CPU utilization report.
260
261       -d     Display the device utilization report.
262
263       --dec={ 0 | 1 | 2 }
264              Specify  the  number  of  decimal places to use (0 to 2, default
265              value is 2).
266
267       -g group_name { device [...] | ALL }
268              Display statistics for a group of devices.  The  iostat  command
269              reports statistics for each individual device in the list then a
270              line of global statistics for the group displayed as  group_name
271              and  made  up  of  all  the devices in the list. The ALL keyword
272              means that all the block devices defined by the system shall  be
273              included in the group.
274
275       -H     This  option must be used with option -g and indicates that only
276              global statistics for the group are to  be  displayed,  and  not
277              statistics for individual devices in the group.
278
279       -h     Make  the  Device  Utilization Report easier to read by a human.
280              --human is enabled implicitly with this option.
281
282       --human
283              Print sizes in human readable format  (e.g.  1.0k,  1.2M,  etc.)
284              The units displayed with this option supersede any other default
285              units (e.g.  kilobytes, sectors...) associated with the metrics.
286
287       -j { ID | LABEL | PATH | UUID | ... } [ device [...] | ALL ]
288              Display persistent device names. Options ID, LABEL, etc. specify
289              the  type of the persistent name. These options are not limited,
290              only prerequisite is that  directory  with  required  persistent
291              names is present in /dev/disk.  Optionally, multiple devices can
292              be specified in the chosen persistent name type.   Because  per‐
293              sistent device names are usually long, option
294
295       -k     Display statistics in kilobytes per second.
296
297       -m     Display statistics in megabytes per second.
298
299       -N     Display the registered device mapper names for any device mapper
300              devices.  Useful for viewing LVM2 statistics.
301
302       -o JSON
303              Display the statistics in JSON (Javascript Object Notation) for‐
304              mat.   JSON  output field order is undefined, and new fields may
305              be added in the future.
306
307       -p [ { device [,...] | ALL } ]
308              The -p option displays statistics  for  block  devices  and  all
309              their  partitions that are used by the system.  If a device name
310              is entered on the command line, then statistics for it  and  all
311              its  partitions  are  displayed. Last, the ALL keyword indicates
312              that statistics have to be displayed for all the  block  devices
313              and  partitions defined by the system, including those that have
314              never been used. If option -j is  defined  before  this  option,
315              devices  entered  on  the command line can be specified with the
316              chosen persistent name type.
317
318       -s     Display a short (narrow) version of the report that  should  fit
319              in 80 characters wide screens.
320
321       -t     Print  the  time for each report displayed. The timestamp format
322              may depend on the value of the S_TIME_FORMAT  environment  vari‐
323              able (see below).
324
325       -V     Print version number then exit.
326
327       -x     Display extended statistics.
328
329       -y     Omit first report with statistics since system boot, if display‐
330              ing multiple records at given interval.
331
332       -z     Tell iostat to omit output for any devices for which  there  was
333              no activity during the sample period.
334
335

ENVIRONMENT

337       The  iostat  command takes into account the following environment vari‐
338       ables:
339
340
341       POSIXLY_CORRECT
342              When this variable is set, transfer rates are shown in  512-byte
343              blocks instead of the default 1K blocks.
344
345
346       S_COLORS
347              When  this  variable  is set, display statistics in color on the
348              terminal.  Possible values for this variable are  never,  always
349              or auto (the latter is the default).
350
351              Please  note  that  the  color (being red, yellow, or some other
352              color) used to display a value is not indicative of any kind  of
353              issue  simply  because of the color. It only indicates different
354              ranges of values.
355
356
357       S_COLORS_SGR
358              Specify the colors and other attributes used to display  statis‐
359              tics  on  the  terminal.  Its value is a colon-separated list of
360              capabilities            that             defaults             to
361              H=31;1:I=32;22:M=35;1:N=34;1:Z=34;22.    Supported  capabilities
362              are:
363
364
365              H=     SGR (Select Graphic Rendition) substring  for  percentage
366                     values greater than or equal to 75%.
367
368
369              I=     SGR substring for device names.
370
371
372              M=     SGR substring for percentage values in the range from 50%
373                     to 75%.
374
375
376              N=     SGR substring for non-zero statistics values.
377
378
379              Z=     SGR substring for zero values.
380
381
382       S_TIME_FORMAT
383              If this variable exists and its value is ISO  then  the  current
384              locale  will  be  ignored  when  printing the date in the report
385              header. The iostat command will use the ISO 8601  format  (YYYY-
386              MM-DD)  instead.   The  timestamp  displayed with option -t will
387              also be compliant with ISO 8601 format.
388
389

EXAMPLES

391       iostat
392              Display a single history since  boot  report  for  all  CPU  and
393              Devices.
394
395       iostat -d 2
396              Display a continuous device report at two second intervals.
397
398       iostat -d 2 6
399              Display six reports at two second intervals for all devices.
400
401       iostat -x sda sdb 2 6
402              Display  six reports of extended statistics at two second inter‐
403              vals for devices sda and sdb.
404
405       iostat -p sda 2 6
406              Display six reports at two second intervals for device  sda  and
407              all its partitions (sda1, etc.)
408

BUGS

410       /proc filesystem must be mounted for iostat to work.
411
412       Kernels older than 2.6.x are no longer supported.
413

FILES

415       /proc/stat contains system statistics.
416
417       /proc/uptime contains system uptime.
418
419       /proc/diskstats contains disks statistics.
420
421       /sys contains statistics for block devices.
422
423       /proc/self/mountstats contains statistics for network filesystems.
424
425       /dev/disk contains persistent device names.
426

AUTHOR

428       Sebastien Godard (sysstat <at> orange.fr)
429

SEE ALSO

431       sar(1),  pidstat(1),  mpstat(1),  vmstat(8), tapestat(1), nfsiostat(1),
432       cifsiostat(1)
433
434       https://github.com/sysstat/sysstat
435
436       http://pagesperso-orange.fr/sebastien.godard/
437
438
439
440Linux                            DECEMBER 2019                       IOSTAT(1)
Impressum