1IOSTAT(1) Linux User's Manual IOSTAT(1)
2
3
4
6 iostat - Report Central Processing Unit (CPU) statistics and input/out‐
7 put statistics for devices and partitions.
8
10 iostat [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -t ] [ -V ] [ -x ] [
11 -y ] [ -z ] [ -j { ID | LABEL | PATH | UUID | ... } ] [ [ -T ] -g
12 group_name ] [ -p [ device [,...] | ALL ] ] [ device [...] | ALL ] [
13 interval [ count ] ]
14
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 first report contains statistics for the time since
34 system startup (boot), unless the -y option is used (in this case, this
35 report is omitted). Each subsequent report contains statistics col‐
36 lected during the interval since the previous report. The count parame‐
37 ter can be specified in conjunction with the interval parameter. If the
38 count parameter is specified, the value of count determines the number
39 of reports generated at interval seconds apart. If the interval parame‐
40 ter is specified without the count parameter, the iostat command gener‐
41 ates reports continuously.
42
43
45 The iostat command generates two types of reports, the CPU Utilization
46 report and the Device Utilization 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. Transfer rates are shown in 1K
92 blocks by default, unless the environment variable POSIXLY_COR‐
93 RECT is set, in which case 512-byte blocks are used. The report
94 may show the following fields, depending on the flags used:
95
96 Device:
97 This column gives the device (or partition) name as
98 listed in the /dev directory.
99
100 tps
101 Indicate the number of transfers per second that were
102 issued to the device. A transfer is an I/O request to the
103 device. Multiple logical requests can be combined into a
104 single I/O request to the device. A transfer is of inde‐
105 terminate size.
106
107 Blk_read/s (kB_read/s, MB_read/s)
108 Indicate the amount of data read from the device
109 expressed in a number of blocks (kilobytes, megabytes)
110 per second. Blocks are equivalent to sectors and there‐
111 fore have a size of 512 bytes.
112
113 Blk_wrtn/s (kB_wrtn/s, MB_wrtn/s)
114 Indicate the amount of data written to the device
115 expressed in a number of blocks (kilobytes, megabytes)
116 per second.
117
118 Blk_read (kB_read, MB_read)
119 The total number of blocks (kilobytes, megabytes) read.
120
121 Blk_wrtn (kB_wrtn, MB_wrtn)
122 The total number of blocks (kilobytes, megabytes) writ‐
123 ten.
124
125 rrqm/s
126 The number of read requests merged per second that were
127 queued to the device.
128
129 wrqm/s
130 The number of write requests merged per second that were
131 queued to the device.
132
133 r/s
134 The number (after merges) of read requests completed per
135 second for the device.
136
137 w/s
138 The number (after merges) of write requests completed per
139 second for the device.
140
141 rsec/s (rkB/s, rMB/s)
142 The number of sectors (kilobytes, megabytes) read from
143 the device per second.
144
145 wsec/s (wkB/s, wMB/s)
146 The number of sectors (kilobytes, megabytes) written to
147 the device per second.
148
149 avgrq-sz
150 The average size (in sectors) of the requests that were
151 issued to the device.
152
153 avgqu-sz
154 The average queue length of the requests that were issued
155 to the device.
156
157 await
158 The average time (in milliseconds) for I/O requests
159 issued to the device to be served. This includes the time
160 spent by the requests in queue and the time spent servic‐
161 ing them.
162
163 r_await
164 The average time (in milliseconds) for read requests
165 issued to the device to be served. This includes the time
166 spent by the requests in queue and the time spent servic‐
167 ing them.
168
169 w_await
170 The average time (in milliseconds) for write requests
171 issued to the device to be served. This includes the time
172 spent by the requests in queue and the time spent servic‐
173 ing them.
174
175 svctm
176 The average service time (in milliseconds) for I/O
177 requests that were issued to the device. Warning! Do not
178 trust this field any more. This field will be removed in
179 a future sysstat version.
180
181 %util
182 Percentage of elapsed time during which I/O requests were
183 issued to the device (bandwidth utilization for the
184 device). Device saturation occurs when this value is
185 close to 100%.
186
188 -c Display the CPU utilization report.
189
190 -d Display the device utilization report.
191
192 -g group_name { device [...] | ALL }
193 Display statistics for a group of devices. The iostat command
194 reports statistics for each individual device in the list then a
195 line of global statistics for the group displayed as group_name
196 and made up of all the devices in the list. The ALL keyword
197 means that all the block devices defined by the system shall be
198 included in the group.
199
200 -h Make the Device Utilization Report easier to read by a human.
201
202 -j { ID | LABEL | PATH | UUID | ... } [ device [...] | ALL ]
203 Display persistent device names. Options ID, LABEL, etc. specify
204 the type of the persistent name. These options are not limited,
205 only prerequisite is that directory with required persistent
206 names is present in /dev/disk. Optionally, multiple devices can
207 be specified in the chosen persistent name type. Because per‐
208 sistent device names are usually long, option -h is enabled
209 implicitly with this option.
210
211 -k Display statistics in kilobytes per second.
212
213 -m Display statistics in megabytes per second.
214
215 -N Display the registered device mapper names for any device mapper
216 devices. Useful for viewing LVM2 statistics.
217
218 -p [ { device [,...] | ALL } ]
219 The -p option displays statistics for block devices and all
220 their partitions that are used by the system. If a device name
221 is entered on the command line, then statistics for it and all
222 its partitions are displayed. Last, the ALL keyword indicates
223 that statistics have to be displayed for all the block devices
224 and partitions defined by the system, including those that have
225 never been used. If option -j is defined before this option,
226 devices entered on the command line can be specified with the
227 chosen persistent name type.
228
229 -T This option must be used with option -g and indicates that only
230 global statistics for the group are to be displayed, and not
231 statistics for individual devices in the group.
232
233 -t Print the time for each report displayed. The timestamp format
234 may depend on the value of the S_TIME_FORMAT environment vari‐
235 able (see below).
236
237 -V Print version number then exit.
238
239 -x Display extended statistics.
240
241 -y Omit first report with statistics since system boot, if display‐
242 ing multiple records at given interval.
243
244 -z Tell iostat to omit output for any devices for which there was
245 no activity during the sample period.
246
247
249 The iostat command takes into account the following environment vari‐
250 ables:
251
252
253 S_TIME_FORMAT
254 If this variable exists and its value is ISO then the current
255 locale will be ignored when printing the date in the report
256 header. The iostat command will use the ISO 8601 format (YYYY-
257 MM-DD) instead. The timestamp displayed with option -t will
258 also be compliant with ISO 8601 format.
259
260
261 POSIXLY_CORRECT
262 When this variable is set, transfer rates are shown in 512-byte
263 blocks instead of the default 1K blocks.
264
265
267 iostat
268 Display a single history since boot report for all CPU and
269 Devices.
270
271 iostat -d 2
272 Display a continuous device report at two second intervals.
273
274 iostat -d 2 6
275 Display six reports at two second intervals for all devices.
276
277 iostat -x sda sdb 2 6
278 Display six reports of extended statistics at two second inter‐
279 vals for devices sda and sdb.
280
281 iostat -p sda 2 6
282 Display six reports at two second intervals for device sda and
283 all its partitions (sda1, etc.)
284
286 /proc filesystem must be mounted for iostat to work.
287
288 Kernels older than 2.6.x are no longer supported.
289
290 The average service time (svctm field) value is meaningless, as I/O
291 statistics are now calculated at block level, and we don't know when
292 the disk driver starts to process a request. For this reason, this
293 field will be removed in a future sysstat version.
294
296 /proc/stat contains system statistics.
297
298 /proc/uptime contains system uptime.
299
300 /proc/diskstats contains disks statistics.
301
302 /sys contains statistics for block devices.
303
304 /proc/self/mountstats contains statistics for network filesystems.
305
306 /dev/disk contains persistent device names.
307
309 Sebastien Godard (sysstat <at> orange.fr)
310
312 sar(1), pidstat(1), mpstat(1), vmstat(8), nfsiostat(1), cifsiostat(1)
313
314 http://pagesperso-orange.fr/sebastien.godard/
315
316
317
318Linux NOVEMBER 2012 IOSTAT(1)