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, partitions and network filesystems (NFS).
8

SYNOPSIS

10       iostat [ -c ] [ -d ] [ -n ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ device [
11       ... ] | ALL ] [ -p [ device | ALL ] ] [ interval [ count ] ]
12

DESCRIPTION

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

REPORTS

43       The iostat command generates three types of reports, the  CPU  Utiliza‐
44       tion  report,  the Device Utilization report and the Network Filesystem
45       report.
46
47       CPU Utilization Report
48              The first report generated by the iostat command is the CPU Uti‐
49              lization  Report. For multiprocessor systems, the CPU values are
50              global averages among all processors.  The report has  the  fol‐
51              lowing format:
52
53              %user
54                     Show  the  percentage  of  CPU  utilization that occurred
55                     while executing at the user level (application).
56              %nice
57                     Show the percentage  of  CPU  utilization  that  occurred
58                     while executing at the user level with nice priority.
59              %system
60                     Show  the  percentage  of  CPU  utilization that occurred
61                     while executing at the system level (kernel).
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              %steal
67                     Show the percentage of time spent in involuntary wait  by
68                     the  virtual CPU or CPUs while the hypervisor was servic‐
69                     ing another virtual processor.
70              %idle
71                     Show the percentage of time that the  CPU  or  CPUs  were
72                     idle  and the system did not have an outstanding disk I/O
73                     request.
74
75       Device Utilization Report
76              The second report generated by the iostat command is the  Device
77              Utilization  Report.  The device report provides statistics on a
78              per physical device or partition basis. Block devices for  which
79              statistics  are  to  be  displayed may be entered on the command
80              line. Partitions may also be entered on the command line provid‐
81              ing  that  option -x is not used.  If no device nor partition is
82              entered, then statistics are displayed for every device used  by
83              the  system,  and providing that the kernel maintains statistics
84              for it.  If the ALL keyword is given on the command  line,  then
85              statistics are displayed for every device defined by the system,
86              including those that have never been used.  The report may  show
87              the following fields, depending on the flags used:
88
89              Device:
90                     This  column  gives the device (or partition) name, which
91                     is displayed as hdiskn with  2.2  kernels,  for  the  nth
92                     device. It is displayed as devm-n with 2.4 kernels, where
93                     m is the major number of the device, and n a  distinctive
94                     number.  With newer kernels, the device name as listed in
95                     the /dev directory is displayed.
96
97              tps
98                     Indicate the number of transfers  per  second  that  were
99                     issued to the device. A transfer is an I/O request to the
100                     device. Multiple logical requests can be combined into  a
101                     single  I/O request to the device. A transfer is of inde‐
102                     terminate size.
103
104              Blk_read/s
105                     Indicate  the  amount  of  data  read  from  the   device
106                     expressed  in  a  number of blocks per second. Blocks are
107                     equivalent to sectors with  kernels  2.4  and  later  and
108                     therefore have a size of 512 bytes. With older kernels, a
109                     block is of indeterminate size.
110
111              Blk_wrtn/s
112                     Indicate  the  amount  of  data  written  to  the  device
113                     expressed in a number of blocks per second.
114
115              Blk_read
116                     The total number of blocks read.
117
118              Blk_wrtn
119                     The total number of blocks written.
120
121              kB_read/s
122                     Indicate   the  amount  of  data  read  from  the  device
123                     expressed in kilobytes per second.
124
125              kB_wrtn/s
126                     Indicate  the  amount  of  data  written  to  the  device
127                     expressed in kilobytes per second.
128
129              kB_read
130                     The total number of kilobytes read.
131
132              kB_wrtn
133                     The total number of kilobytes written.
134
135              MB_read/s
136                     Indicate   the  amount  of  data  read  from  the  device
137                     expressed in megabytes per second.
138
139              MB_wrtn/s
140                     Indicate  the  amount  of  data  written  to  the  device
141                     expressed in megabytes per second.
142
143              MB_read
144                     The total number of megabytes read.
145
146              MB_wrtn
147                     The total number of megabytes written.
148
149              rrqm/s
150                     The  number  of read requests merged per second that were
151                     queued to the device.
152
153              wrqm/s
154                     The number of write requests merged per second that  were
155                     queued to the device.
156
157              r/s
158                     The  number  of  read  requests  that  were issued to the
159                     device per second.
160
161              w/s
162                     The number of write requests  that  were  issued  to  the
163                     device per second.
164
165              rsec/s
166                     The number of sectors read from the device per second.
167
168              wsec/s
169                     The number of sectors written to the device per second.
170
171              rkB/s
172                     The number of kilobytes read from the device per second.
173
174              wkB/s
175                     The number of kilobytes written to the device per second.
176
177              rMB/s
178                     The number of megabytes read from the device per second.
179
180              wMB/s
181                     The number of megabytes written to the device per second.
182
183              avgrq-sz
184                     The  average  size (in sectors) of the requests that were
185                     issued to the device.
186
187              avgqu-sz
188                     The average queue length of the requests that were issued
189                     to the device.
190
191              await
192                     The  average  time  (in  milliseconds)  for  I/O requests
193                     issued to the device to be served. This includes the time
194                     spent by the requests in queue and the time spent servic‐
195                     ing them.
196
197              svctm
198                     The  average  service  time  (in  milliseconds)  for  I/O
199                     requests that were issued to the device.
200
201              %util
202                     Percentage  of  CPU  time  during which I/O requests were
203                     issued to  the  device  (bandwidth  utilization  for  the
204                     device).  Device  saturation  occurs  when  this value is
205                     close to 100%.
206
207       Network Filesystem report
208              The Network Filesystem (NFS) report provides statistics for each
209              mounted  network  filesystem.   The  report  shows the following
210              fields:
211
212              Filesystem:
213                     This columns shows the hostname of the  NFS  server  fol‐
214                     lowed by a colon and by the directory name where the net‐
215                     work filesystem is mounted.
216
217              rBlk_nor/s
218                     Indicate the number of blocks read  by  applications  via
219                     the  read(2) system call interface. A block has a size of
220                     512 bytes.
221
222              wBlk_nor/s
223                     Indicate the number of blocks written by applications via
224                     the write(2) system call interface.
225
226              rBlk_dir/s
227                     Indicate the number of blocks read from files opened with
228                     the O_DIRECT flag.
229
230              wBlk_dir/s
231                     Indicate the number of blocks  written  to  files  opened
232                     with the O_DIRECT flag.
233
234              rBlk_svr/s
235                     Indicate the number of blocks read from the server by the
236                     NFS client via an NFS READ request.
237
238              wBlk_svr/s
239                     Indicate the number of blocks written to  the  server  by
240                     the NFS client via an NFS WRITE request.
241
242              rkB_nor/s
243                     Indicate the number of kilobytes read by applications via
244                     the read(2) system call interface.
245
246              wkB_nor/s
247                     Indicate the number of kilobytes written by  applications
248                     via the write(2) system call interface.
249
250              rkB_dir/s
251                     Indicate  the  number of kilobytes read from files opened
252                     with the O_DIRECT flag.
253
254              wkB_dir/s
255                     Indicate the number of kilobytes written to files  opened
256                     with the O_DIRECT flag.
257
258              rkB_svr/s
259                     Indicate  the number of kilobytes read from the server by
260                     the NFS client via an NFS READ request.
261
262              wkB_svr/s
263                     Indicate the number of kilobytes written to the server by
264                     the NFS client via an NFS WRITE request.
265
266              rMB_nor/s
267                     Indicate the number of megabytes read by applications via
268                     the read(2) system call interface.
269
270              wMB_nor/s
271                     Indicate the number of megabytes written by  applications
272                     via the write(2) system call interface.
273
274              rMB_dir/s
275                     Indicate  the  number of megabytes read from files opened
276                     with the O_DIRECT flag.
277
278              wMB_dir/s
279                     Indicate the number of megabytes written to files  opened
280                     with the O_DIRECT flag.
281
282              rMB_svr/s
283                     Indicate  the number of megabytes read from the server by
284                     the NFS client via an NFS READ request.
285
286              wMB_svr/s
287                     Indicate the number of megabytes written to the server by
288                     the NFS client via an NFS WRITE request.
289

OPTIONS

291       -c     Display the CPU utilization report.
292
293       -d     Display the device utilization report.
294
295       -k     Display statistics in kilobytes per second instead of blocks per
296              second.  Data displayed are valid  only  with  kernels  2.4  and
297              later.
298
299       -m     Display  statistics in megabytes per second instead of blocks or
300              kilobytes per second.  Data displayed are valid only  with  ker‐
301              nels 2.4 and later.
302
303       -n     Display  the  network filesystem (NFS) report. This option works
304              only with kernel 2.6.17 and later.
305
306       -p [ { device | ALL } ]
307              The -p option is exclusive of the -x option and displays statis‐
308              tics for block devices and all their partitions that are used by
309              the system.  If a device name is entered on  the  command  line,
310              then  statistics  for  it  and all its partitions are displayed.
311              Last, the ALL keyword indicates that statistics have to be  dis‐
312              played  for  all the block devices and partitions defined by the
313              system, including those that have never been  used.   Note  that
314              this option works only with post 2.5 kernels.
315
316       -t     Print the time for each report displayed.
317
318       -V     Print version number then exit.
319
320       -x     Display extended statistics.  This option is exclusive of the -p
321              one,  and  works  with  post  2.5   kernels   since   it   needs
322              /proc/diskstats  file  or a mounted sysfs to get the statistics.
323              This option may also work with older kernels (e.g. 2.4) only  if
324              extended  statistics are available in /proc/partitions (the ker‐
325              nel needs to be patched for that).
326
327

ENVIRONMENT

329       The iostat command takes into account the following  environment  vari‐
330       able:
331
332
333       S_TIME_FORMAT
334              If  this  variable  exists and its value is ISO then the current
335              locale will be ignored when printing  the  date  in  the  report
336              header.  The  iostat command will use the ISO 8601 format (YYYY-
337              MM-DD) instead.
338
339

EXAMPLES

341       iostat
342              Display a single history since  boot  report  for  all  CPU  and
343              Devices.
344
345       iostat -d 2
346              Display a continuous device report at two second intervals.
347
348       iostat -d 2 6
349              Display six reports at two second intervals for all devices.
350
351       iostat -x hda hdb 2 6
352              Display  six reports of extended statistics at two second inter‐
353              vals for devices hda and hdb.
354
355       iostat -p sda 2 6
356              Display six reports at two second intervals for device  sda  and
357              all its partitions (sda1, etc.)
358

BUGS

360       /proc filesystem must be mounted for iostat to work.
361
362       On  SMP  machines  iostat assumes that CPU #0 is never disabled. Indeed
363       iostat uses it to calculate the time interval.
364
365       Extended statistics are available only with post 2.5 kernels.
366

FILES

368       /proc/stat contains system statistics.
369
370       /proc/partitions contains disk statistics (for  pre  2.5  kernels  that
371       have been patched).
372
373       /proc/diskstats contains disks statistics (for post 2.5 kernels).
374
375       /sys contains statistics for block devices (post 2.5 kernels).
376
377       /proc/self/mountstats contains statistics for network filesystems.
378

AUTHOR

380       Sebastien Godard (sysstat <at> wanadoo.fr)
381

SEE ALSO

383       sar(1), mpstat(1), vmstat(8)
384
385       http://perso.orange.fr/sebastien.godard/
386
387
388
389Linux                            JANUARY 2007                        IOSTAT(1)
Impressum