1 IOSTAT(1M) Maintenance Commands IOSTAT(1M) 2 3 4 5 NAME 6 iostat - report I/O statistics 7 8 SYNOPSIS 9 /usr/bin/iostat [-cCdDeEiImMnpPfFrstxXYz] [-l n] [-T u | d] 10 [disk]... [interval [count]] 11 12 13 DESCRIPTION 14 The iostat utility iteratively reports terminal, disk, and tape I/O 15 activity, as well as CPU utilization. The first line of output is for 16 all time since boot; each subsequent line is for the prior interval 17 only. 18 19 20 To compute this information, the kernel maintains a number of counters. 21 For each disk, the kernel counts reads, writes, bytes read, and bytes 22 written. The kernel also takes hi-res time stamps at queue entry and 23 exit points, which allows it to keep track of the residence time and 24 cumulative residence-length product for each queue. Using these values, 25 iostat produces highly accurate measures of throughput, utilization, 26 queue lengths, transaction rates and service time. For terminals 27 collectively, the kernel simply counts the number of input and output 28 characters. 29 30 31 During execution of the kernel status command, the state of the system 32 can change. If relevant, a state change message is included in the 33 iostat output, in one of the following forms: 34 35 <<device added: sd0>> 36 <<device removed: sd0>> 37 <<partition added: sd0,a>> 38 <<partition removed: sd0,a>> 39 <<NFS mounted: nfs1>> 40 <<NFS unmounted: nfs1>> 41 <<multi-path added: ssd4>> 42 <<multi-path removed: ssd4>> 43 <<controller added: c1>> 44 <<controller removed: c1>> 45 <<processors added: 1, 3>> 46 <<processors removed: 1, 3>> 47 48 49 50 51 Note that the names printed in these state change messages are affected 52 by the -n and -m options as appropriate. 53 54 55 For more general system statistics, use sar(1), sar(1M), or vmstat(1M). 56 57 Output 58 The output of the iostat utility includes the following information. 59 60 device 61 name of the disk 62 63 64 r/s 65 reads per second 66 67 68 w/s 69 writes per second 70 71 72 kr/s 73 kilobytes read per second 74 75 The average I/O size during the interval can be computed from 76 kr/s divided by r/s. 77 78 79 kw/s 80 kilobytes written per second 81 82 The average I/O size during the interval can be computed from 83 kw/s divided by w/s. 84 85 86 wait 87 average number of transactions waiting for service (queue 88 length) 89 90 This is the number of I/O operations held in the device 91 driver queue waiting for acceptance by the device. 92 93 94 actv 95 average number of transactions actively being serviced 96 (removed from the queue but not yet completed) 97 98 This is the number of I/O operations accepted, but not yet 99 serviced, by the device. 100 101 102 svc_t 103 average response time of transactions, in milliseconds 104 105 The svc_t output reports the overall response time, rather 106 than the service time, of a device. The overall time includes 107 the time that transactions are in queue and the time that 108 transactions are being serviced. The time spent in queue is 109 shown with the -x option in the wsvc_t output column. The 110 time spent servicing transactions is the true service time. 111 Service time is also shown with the -x option and appears in 112 the asvc_t output column of the same report. 113 114 115 %w 116 percent of time there are transactions waiting for service 117 (queue non-empty) 118 119 120 %b 121 percent of time the disk is busy (transactions in progress) 122 123 124 wsvc_t 125 average service time in wait queue, in milliseconds 126 127 128 asvc_t 129 average service time of active transactions, in milliseconds 130 131 132 OPTIONS 133 The following options are supported: 134 135 -c 136 Report the percentage of time the system has spent in user 137 mode, in system mode, in dtrace probes, and idling. See the 138 NOTES section and mpstat(1m) for more information. 139 140 141 -C 142 When the -x option is also selected, report extended disk 143 statistics aggregated by controller id. 144 145 146 -d 147 For each disk, report the number of kilobytes transferred 148 per second, the number of transfers per second, and the 149 average service time in milliseconds. 150 151 152 -D 153 For each disk, report the reads per second, writes per 154 second, and percentage disk utilization. 155 156 157 -e 158 Display device error summary statistics. The total errors, 159 hard errors, soft errors, and transport errors are 160 displayed. 161 162 163 -E 164 Display all device error statistics. 165 166 167 -i 168 In -E output, display the Device ID instead of the Serial 169 No. The Device Id is a unique identifier registered by a 170 driver through ddi_devid_register(9F). 171 172 173 -I 174 Report the counts in each interval, rather than rates 175 (where applicable). 176 177 178 -l n 179 Limit the number of disks included in the report to n; the 180 disk limit defaults to 4 for -d and -D, and unlimited for 181 -x. Note: disks explicitly requested (see disk below) are 182 not subject to this disk limit. 183 184 185 -m 186 Report file system mount points. This option is most useful 187 if the -P or -p option is also specified or used in 188 conjunction with -Xn or -en. The -m option is useful only 189 if the mount point is actually listed in the output. This 190 option can only be used in conjunction with the -n option. 191 192 193 -M 194 Display data throughput in MB/sec instead of KB/sec. 195 196 197 -n 198 Display names in descriptive format. For example, cXtYdZ, 199 rmt/N, server:/export/path. 200 201 By default, disks are identified by instance names such as 202 ssd23 or md301. Combining the -n option with the -x option 203 causes disk names to display in the cXtYdZsN format which 204 is more easily associated with physical hardware 205 characteristics. The cXtYdZsN format is particularly useful 206 in FibreChannel (FC) environments where the FC World Wide 207 Name appears in the t field. 208 209 210 -p 211 For each disk, report per-partition statistics in addition 212 to per-device statistics. 213 214 215 -P 216 For each disk, report per-partition statistics only, no 217 per-device statistics. 218 219 220 -f 221 Report ZFS-level statistics for ZFS pool and individual 222 vdevs in addition to per-device statistics. 223 224 225 -F 226 Report ZFS pool and individual physical vdevs statistics 227 only, no per-device statistics. 228 229 230 -r 231 Display data in a comma-separated format. 232 233 234 -s 235 Suppress messages related to state changes. 236 237 238 -t 239 Report the number of characters read and written to 240 terminals per second. 241 242 243 -T u | d 244 Display a time stamp. 245 246 Specify u for a printed representation of the internal 247 representation of time. See time(2). Specify d for standard 248 date format. See date(1). 249 250 251 -X 252 For disks under scsi_vhci(7D) control, in addition to disk 253 lun statistics, also report statistics for lun.controller. 254 255 256 -x 257 Report extended disk statistics. By default, disks are 258 identified by instance names such as ssd23 or md301. 259 Combining the x option with the -n option causes disk names 260 to display in the cXtYdZsN format, more easily associated 261 with physical hardware characteristics. Using the cXtYdZsN 262 format is particularly helpful in the FibreChannel 263 environments where the FC World Wide Name appears in the t 264 field. 265 266 If no output display is requested (no -x, -e, -E), -x is 267 implied. 268 269 270 -Y 271 For disks under scsi_vhci(7D) control, in addition to disk 272 lun statistics, also report statistics for lun.targetport 273 and lun.targetport.controller. 274 275 In -n (descriptive) mode the targetport is shown in using 276 the target-port property of the path. Without -n the 277 targetport is shown using the shorter port-id. All target 278 ports with the same target-port property value share the 279 same port-id. The target-port-to-port-id association does 280 not persist across reboot. 281 282 If no output display is requested (no -x, -e, -E), -x is 283 implied. 284 285 286 -z 287 Do not print lines whose underlying data values are all 288 zeros. 289 290 291 292 The option set -xcnCXTdz interval is particularly useful for 293 determining whether disk I/O problems exist and for identifying 294 problems. 295 296 OPERANDS 297 The following operands are supported: 298 299 count 300 Display only count reports. 301 302 303 disk 304 Explicitly specify the disks to be reported; in addition to 305 any explicit disks, any active disks up to the disk limit 306 (see -l above) will also be reported. 307 308 309 interval 310 Report once each interval seconds. 311 312 313 EXAMPLES 314 Example 1 Using iostat to Generate User and System Operation Statistics 315 316 317 The following command displays two reports of extended device 318 statistics, aggregated by controller id, for user (us) and system (sy) 319 operations. Because the -n option is used with the -x option, devices 320 are identified by controller names. 321 322 323 example% iostat -xcnCXTdz 5 324 325 326 Mon Nov 24 14:58:36 2003 327 cpu 328 us sy dt id 329 14 31 0 20 330 extended device statistics 331 r/s w/s kr/s kw wait actv wsvc_t asvc_t %w %b device 332 3.8 29.9 145.8 44.0 0.0 0.2 0.1 6.4 0 5 c0 333 666.3 814.8 12577.6 17591.1 91.3 82.3 61.6 55.6 0 2 c12 334 180.0 234.6 4401.1 5712.6 0.0 147.7 0.0 356.3 0 98 d10 335 336 Mon Nov 24 14:58:41 2003 337 cpu 338 us sy dt id 339 11 31 1 22 340 extended device statistics 341 r/s w/s kr/s kw wait actv wsvc_t asvc_t %w %b device 342 0.8 41.0 5.2 20.5 0.0 0.2 0.2 4.4 0 6 c0 343 565.3 581.7 8573.2 10458.9 0.0 26.6 0.0 23.2 0 3 c12 344 106.5 81.3 3393.2 1948.6 0.0 5.7 0.0 30.1 0 99 d10 345 346 347 348 Example 2 Using iostat to Generate TTY Statistics 349 350 351 The following command displays two reports on the activity of five 352 disks in different modes of operation. Because the -x option is used, 353 disks are identified by instance names. 354 355 356 example% iostat -x tc 5 2 357 358 359 extended device statistics tty cpu 360 device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy dt id 361 sd0 0.4 0.3 10.4 8.0 0.0 0.0 36.9 0 1 0 10 0 0 0 99 362 sd1 0.0 0.0 0.3 0.4 0.0 0.0 35.0 0 0 363 sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 364 nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 365 nfs2 0.0 0.0 0.0 0.1 0.0 0.0 35.6 0 0 366 extended device statistics tty cpu 367 device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy dt id 368 sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 155 0 0 0 100 369 sd1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 370 sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 371 nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 372 nfs2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 373 374 375 376 377 Example 3 Using iostat to Generate Partition and Device Statistics 378 379 380 The following command generates partition and device statistics for 381 each disk. Because the -n option is used with the -x option, disks are 382 identified by controller names. 383 384 385 example% iostat -xnp 386 387 extended device statistics 388 r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 389 0.4 0.3 10.4 7.9 0.0 0.0 0.0 36.9 0 1 c0t0d0 390 0.3 0.3 9.0 7.3 0.0 0.0 0.0 37.2 0 1 c0t0d0s0 391 0.0 0.0 0.1 0.5 0.0 0.0 0.0 34.0 0 0 c0t0d0s1 392 0.0 0.0 0.0 0.1 0.0 0.0 0.6 35.0 0 0 fuji:/export/home/user3 393 394 395 396 Example 4 Show Translation from Instance Name to Descriptive Name 397 398 399 The following example illustrates the use of iostat to translate a 400 specific instance name to a descriptive name. 401 402 403 example% iostat -xn sd1 404 extended device statistics 405 r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 406 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 c8t1d0 407 408 409 410 Example 5 Show Target Port and Controller Activity for a Specific Disk 411 412 413 In the following example, there are four controllers, all connected to 414 the same target port. 415 416 417 # iostat -Y ssd22 418 extended device statistics 419 device r/s w/s kr/s kw/s wait actv svc_t %w %b 420 ssd22 0.2 0.0 1.5 0.0 0.0 0.0 0.7 0 0 421 ssd22.t2 0.2 0.0 1.5 0.0 0.0 0.0 0.0 0 0 422 ssd22.t2.fp0 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0 423 ssd22.t2.fp1 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0 424 ssd22.t2.fp2 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0 425 ssd22.t2.fp3 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0 426 427 428 429 ATTRIBUTES 430 See attributes(5) for descriptions of the following attributes: 431 432 433 434 435 +--------------------+-----------------+ 436 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 437 +--------------------+-----------------+ 438 |Interface Stability | See below. | 439 +--------------------+-----------------+ 440 441 442 Invocation is evolving. Human readable output is unstable. 443 444 SEE ALSO 445 date(1), sar(1), sar(1M), mpstat(1M), vmstat(1M), time(2), 446 attributes(5), scsi_vhci(7D) 447 448 NOTES 449 The sum of CPU utilization might vary slightly from 100 because of 450 rounding errors in the production of a percentage figure. 451 452 453 The svc_t response time is not particularly significant when the I/0 454 (r/s+w/s) rates are under 0.5 per second. Harmless spikes are fairly 455 normal in such cases. 456 457 458 The mpstat utility reports the same dt, usr, and sys statistics. See 459 mpstat(1M) for more information. 460 461 462 When executed in a zone and if the pools facility is active, iostat(1M) 463 will only provide information for those processors in the processor set 464 of the pool to which the zone is bound. 465 466 467 468 March 23, 2009 IOSTAT(1M)