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 ] [ -n ] [ -h ] [ -k | -m ] [ -t ] [ -V  ]  [
11       -x  ]  [  -z  ] [ device [...] | ALL ] [ -p [ device [,...] | ALL ] ] [
12       interval [ count ] ]
13

DESCRIPTION

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

REPORTS

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

OPTIONS

308       -c     Display the CPU utilization report.
309
310       -d     Display the device utilization report.
311
312       -h     Make the NFS report displayed by option -n easier to read  by  a
313              human.
314
315       -k     Display statistics in kilobytes per second instead of blocks per
316              second.  Data displayed are valid  only  with  kernels  2.4  and
317              later.
318
319       -m     Display  statistics in megabytes per second instead of blocks or
320              kilobytes per second.  Data displayed are valid only  with  ker‐
321              nels 2.4 and later.
322
323       -N     Display the registered device mapper names for any device mapper
324              devices.  Useful for viewing LVM2 statistics.
325
326       -n     Display the network filesystem (NFS) report. This  option  works
327              only with kernel 2.6.17 and later.
328
329       -p [ { device [,...] | ALL } ]
330              The  -p  option  displays  statistics  for block devices and all
331              their partitions that are used by the system.  If a device  name
332              is  entered  on the command line, then statistics for it and all
333              its partitions are displayed. Last, the  ALL  keyword  indicates
334              that  statistics  have to be displayed for all the block devices
335              and partitions defined by the system, including those that  have
336              never been used.  Note that this option works only with post 2.5
337              kernels.
338
339       -t     Print the time for each report displayed. The  timestamp  format
340              may  depend  on the value of the S_TIME_FORMAT environment vari‐
341              able (see below).
342
343       -V     Print version number then exit.
344
345       -x     Display extended statistics.  This option works  with  post  2.5
346              kernels  since  it needs /proc/diskstats file or a mounted sysfs
347              to get the statistics. This option may also work with older ker‐
348              nels  (e.g.  2.4)  only  if extended statistics are available in
349              /proc/partitions (the kernel needs to be patched for that).
350
351       -z     Tell iostat to omit output for any devices for which  there  was
352              no activity during the sample period.
353
354

ENVIRONMENT

356       The  iostat  command takes into account the following environment vari‐
357       able:
358
359
360       S_TIME_FORMAT
361              If this variable exists and its value is ISO  then  the  current
362              locale  will  be  ignored  when  printing the date in the report
363              header. The iostat command will use the ISO 8601  format  (YYYY-
364              MM-DD)  instead.   The  timestamp  displayed with option -t will
365              also be compliant with ISO 8601 format.
366
367

EXAMPLES

369       iostat
370              Display a single history since  boot  report  for  all  CPU  and
371              Devices.
372
373       iostat -d 2
374              Display a continuous device report at two second intervals.
375
376       iostat -d 2 6
377              Display six reports at two second intervals for all devices.
378
379       iostat -x sda sdb 2 6
380              Display  six reports of extended statistics at two second inter‐
381              vals for devices sda and sdb.
382
383       iostat -p sda 2 6
384              Display six reports at two second intervals for device  sda  and
385              all its partitions (sda1, etc.)
386

BUGS

388       /proc filesystem must be mounted for iostat to work.
389
390       Extended statistics are available only with post 2.5 kernels.
391

FILES

393       /proc/stat contains system statistics.
394
395       /proc/uptime contains system uptime.
396
397       /proc/partitions  contains  disk  statistics  (for pre 2.5 kernels that
398       have been patched).
399
400       /proc/diskstats contains disks statistics (for post 2.5 kernels).
401
402       /sys contains statistics for block devices (post 2.5 kernels).
403
404       /proc/self/mountstats contains statistics for network filesystems.
405

AUTHOR

407       Sebastien Godard (sysstat <at> orange.fr)
408

SEE ALSO

410       sar(1), pidstat(1), mpstat(1), vmstat(8)
411
412       http://pagesperso-orange.fr/sebastien.godard/
413
414
415
416Linux                            DECEMBER 2009                       IOSTAT(1)
Impressum