1 '\" te 2 .\" 3 .\" CDDL HEADER START 4 .\" 5 .\" The contents of this file are subject to the terms of the 6 .\" Common Development and Distribution License (the "License"). 7 .\" You may not use this file except in compliance with the License. 8 .\" 9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 .\" or http://www.opensolaris.org/os/licensing. 11 .\" See the License for the specific language governing permissions 12 .\" and limitations under the License. 13 .\" 14 .\" When distributing Covered Code, include this CDDL HEADER in each 15 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 .\" If applicable, add the following below this CDDL HEADER, with the 17 .\" fields enclosed by brackets "[]" replaced with your own identifying 18 .\" information: Portions Copyright [yyyy] [name of copyright owner] 19 .\" 20 .\" CDDL HEADER END 21 .\" 22 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights reserved 23 .\" Copyright (c) 2012 by Delphix. All rights reserved. 24 .\" 25 .TH IOSTAT 1M "Mar 23, 2009" 26 .SH NAME 27 iostat \- report I/O statistics 28 .SH SYNOPSIS 29 .LP 30 .nf 31 \fB/usr/bin/iostat\fR [\fB-cCdDeEiImMnpPfFrstxXYz\fR] [\fB-l\fR \fIn\fR] [\fB-T\fR u | d] 32 [\fIdisk\fR]... [\fIinterval\fR [\fIcount\fR]] 33 .fi 34 35 .SH DESCRIPTION 36 .sp 37 .LP 38 The \fBiostat\fR utility iteratively reports terminal, disk, and tape \fBI/O\fR 39 activity, as well as \fBCPU\fR utilization. The first line of output is for all 40 time since boot; each subsequent line is for the prior interval only. 41 .sp 42 .LP 43 To compute this information, the kernel maintains a number of counters. For 44 each disk, the kernel counts reads, writes, bytes read, and bytes written. The 45 kernel also takes hi-res time stamps at queue entry and exit points, which 46 allows it to keep track of the residence time and cumulative residence-length 47 product for each queue. Using these values, \fBiostat\fR produces highly 48 accurate measures of throughput, utilization, queue lengths, transaction rates 49 and service time. For terminals collectively, the kernel simply counts the 50 number of input and output characters. 51 .sp 52 .LP 53 During execution of the kernel status command, the \fBstate\fR of the system 54 can change. If relevant, a state change message is included in the \fBiostat\fR 55 output, in one of the following forms: 56 .sp 57 .in +2 58 .nf 59 <<device added: sd0>> 60 <<device removed: sd0>> 61 <<partition added: sd0,a>> 62 <<partition removed: sd0,a>> 63 <<NFS mounted: nfs1>> 64 <<NFS unmounted: nfs1>> 65 <<multi-path added: ssd4>> 66 <<multi-path removed: ssd4>> 67 <<controller added: c1>> 68 <<controller removed: c1>> 69 <<processors added: 1, 3>> 70 <<processors removed: 1, 3>> 71 .fi 72 .in -2 73 .sp 74 75 .sp 76 .LP 77 Note that the \fBnames\fR printed in these state change messages are affected 78 by the \fB-n\fR and \fB-m\fR options as appropriate. 79 .sp 80 .LP 81 For more general system statistics, use \fBsar\fR(1), \fBsar\fR(1M), or 82 \fBvmstat\fR(1M). 83 .SS "Output" 84 .sp 85 .LP 86 The output of the \fBiostat\fR utility includes the following information. 87 .sp 88 .ne 2 89 .na 90 \fB\fBdevice\fR\fR 91 .ad 92 .RS 10n 93 name of the disk 94 .RE 95 96 .sp 97 .ne 2 98 .na 99 \fB\fBr/s\fR\fR 100 .ad 101 .RS 10n 102 reads per second 103 .RE 104 105 .sp 106 .ne 2 107 .na 108 \fB\fBw/s\fR\fR 109 .ad 110 .RS 10n 111 writes per second 112 .RE 113 114 .sp 115 .ne 2 116 .na 117 \fB\fBkr/s\fR\fR 118 .ad 119 .RS 10n 120 kilobytes read per second 121 .sp 122 The average I/O size during the interval can be computed from \fBkr/s\fR 123 divided by \fBr/s\fR. 124 .RE 125 126 .sp 127 .ne 2 128 .na 129 \fB\fBkw/s\fR\fR 130 .ad 131 .RS 10n 132 kilobytes written per second 133 .sp 134 The average I/O size during the interval can be computed from \fBkw/s\fR 135 divided by \fBw/s\fR. 136 .RE 137 138 .sp 139 .ne 2 140 .na 141 \fB\fBwait\fR\fR 142 .ad 143 .RS 10n 144 average number of transactions waiting for service (queue length) 145 .sp 146 This is the number of I/O operations held in the device driver queue waiting 147 for acceptance by the device. 148 .RE 149 150 .sp 151 .ne 2 152 .na 153 \fB\fBactv\fR\fR 154 .ad 155 .RS 10n 156 average number of transactions actively being serviced (removed from the queue 157 but not yet completed) 158 .sp 159 This is the number of I/O operations accepted, but not yet serviced, by the 160 device. 161 .RE 162 163 .sp 164 .ne 2 165 .na 166 \fB\fBsvc_t\fR\fR 167 .ad 168 .RS 10n 169 average response time of transactions, in milliseconds 170 .sp 171 The \fBsvc_t\fR output reports the overall \fBresponse\fR time, rather than the 172 \fBservice\fR time, of a device. The overall time includes the time that 173 transactions are in queue and the time that transactions are being serviced. 174 The time spent in queue is shown with the \fB-x\fR option in the \fBwsvc_t\fR 175 output column. The time spent servicing transactions is the true service time. 176 Service time is also shown with the \fB-x\fR option and appears in the 177 \fBasvc_t\fR output column of the same report. 178 .RE 179 180 .sp 181 .ne 2 182 .na 183 \fB\fB%w\fR\fR 184 .ad 185 .RS 10n 186 percent of time there are transactions waiting for service (queue non-empty) 187 .RE 188 189 .sp 190 .ne 2 191 .na 192 \fB\fB%b\fR\fR 193 .ad 194 .RS 10n 195 percent of time the disk is busy (transactions in progress) 196 .RE 197 198 .sp 199 .ne 2 200 .na 201 \fB\fBwsvc_t\fR\fR 202 .ad 203 .RS 10n 204 average service time in wait queue, in milliseconds 205 .RE 206 207 .sp 208 .ne 2 209 .na 210 \fB\fBasvc_t\fR\fR 211 .ad 212 .RS 10n 213 average service time of active transactions, in milliseconds 214 .RE 215 216 .SH OPTIONS 217 .sp 218 .LP 219 The following options are supported: 220 .sp 221 .ne 2 222 .na 223 \fB\fB-c\fR\fR 224 .ad 225 .RS 12n 226 Report the percentage of time the system has spent in user mode, in system 227 mode, in dtrace probes, and idling. See the NOTES section and 228 \fBmpstat\fR(1m) for more information. 229 .RE 230 231 .sp 232 .ne 2 233 .na 234 \fB\fB-C\fR\fR 235 .ad 236 .RS 12n 237 When the \fB-x\fR option is also selected, report extended disk statistics 238 aggregated by \fIcontroller id\fR. 239 .RE 240 241 .sp 242 .ne 2 243 .na 244 \fB\fB-d\fR\fR 245 .ad 246 .RS 12n 247 For each disk, report the number of kilobytes transferred per second, the 248 number of transfers per second, and the average service time in milliseconds. 249 .RE 250 251 .sp 252 .ne 2 253 .na 254 \fB\fB-D\fR\fR 255 .ad 256 .RS 12n 257 For each disk, report the reads per second, writes per second, and percentage 258 disk utilization. 259 .RE 260 261 .sp 262 .ne 2 263 .na 264 \fB\fB-e\fR\fR 265 .ad 266 .RS 12n 267 Display device error summary statistics. The total errors, hard errors, soft 268 errors, and transport errors are displayed. 269 .RE 270 271 .sp 272 .ne 2 273 .na 274 \fB\fB-E\fR\fR 275 .ad 276 .RS 12n 277 Display all device error statistics. 278 .RE 279 280 .sp 281 .ne 2 282 .na 283 \fB\fB-i\fR\fR 284 .ad 285 .RS 12n 286 In \fB-E\fR output, display the \fBDevice ID\fR instead of the \fBSerial No\fR. 287 The \fBDevice Id\fR is a unique identifier registered by a driver through 288 \fBddi_devid_register\fR(9F). 289 .RE 290 291 .sp 292 .ne 2 293 .na 294 \fB\fB-I\fR\fR 295 .ad 296 .RS 12n 297 Report the counts in each interval, rather than rates (where applicable). 298 .RE 299 300 .sp 301 .ne 2 302 .na 303 \fB\fB-l\fR \fIn\fR\fR 304 .ad 305 .RS 12n 306 Limit the number of disks included in the report to \fIn\fR; the disk limit 307 defaults to 4 for \fB-d\fR and \fB-D\fR, and unlimited for \fB-x\fR. Note: 308 disks explicitly requested (see \fIdisk\fR below) are not subject to this disk 309 limit. 310 .RE 311 312 .sp 313 .ne 2 314 .na 315 \fB\fB-m\fR\fR 316 .ad 317 .RS 12n 318 Report file system mount points. This option is most useful if the \fB-P\fR or 319 \fB-p\fR option is also specified or used in conjunction with \fB-Xn\fR or 320 \fB-en\fR. The \fB-m\fR option is useful only if the mount point is actually 321 listed in the output. This option can only be used in conjunction with the 322 \fB-n\fR option. 323 .RE 324 325 .sp 326 .ne 2 327 .na 328 \fB\fB-M\fR\fR 329 .ad 330 .RS 12n 331 Display data throughput in \fBMB\fR/sec instead of KB/sec. 332 .RE 333 334 .sp 335 .ne 2 336 .na 337 \fB\fB-n\fR\fR 338 .ad 339 .RS 12n 340 Display names in descriptive format. For example, \fBcXtYdZ\fR, \fBrmt/N\fR, 341 \fBserver:/export/path\fR. 342 .sp 343 By default, disks are identified by instance names such as \fBssd23\fR or 344 \fBmd301\fR. Combining the \fB-n\fR option with the \fB-x\fR option causes disk 345 names to display in the \fBcXtYdZsN\fR format which is more easily associated 346 with physical hardware characteristics. The \fBcXtYdZsN\fR format is 347 particularly useful in FibreChannel (FC) environments where the FC World Wide 348 Name appears in the \fBt\fR field. 349 .RE 350 351 .sp 352 .ne 2 353 .na 354 \fB\fB-p\fR\fR 355 .ad 356 .RS 12n 357 For each disk, report per-partition statistics in addition to per-device 358 statistics. 359 .RE 360 361 .sp 362 .ne 2 363 .na 364 \fB\fB-P\fR\fR 365 .ad 366 .RS 12n 367 For each disk, report per-partition statistics only, no per-device statistics. 368 .RE 369 370 .sp 371 .ne 2 372 .na 373 \fB\fB-f\fR\fR 374 .ad 375 .RS 12n 376 Report ZFS-level statistics for ZFS pool and individual vdevs in addition to 377 per-device statistics. 378 .RE 379 380 .sp 381 .ne 2 382 .na 383 \fB\fB-F\fR\fR 384 .ad 385 .RS 12n 386 Report ZFS pool and individual physical vdevs statistics only, no per-device 387 statistics. 388 .RE 389 390 .sp 391 .ne 2 392 .na 393 \fB\fB-r\fR\fR 394 .ad 395 .RS 12n 396 Display data in a comma-separated format. 397 .RE 398 399 .sp 400 .ne 2 401 .na 402 \fB\fB-s\fR\fR 403 .ad 404 .RS 12n 405 Suppress messages related to \fBstate changes\fR. 406 .RE 407 408 .sp 409 .ne 2 410 .na 411 \fB\fB-t\fR\fR 412 .ad 413 .RS 12n 414 Report the number of characters read and written to terminals per second. 415 .RE 416 417 .sp 418 .ne 2 419 .na 420 \fB\fB-T\fR u | d\fR 421 .ad 422 .RS 12n 423 Display a time stamp. 424 .sp 425 Specify \fBu\fR for a printed representation of the internal representation of 426 time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See 427 \fBdate\fR(1). 428 .RE 429 430 .sp 431 .ne 2 432 .na 433 \fB\fB-X\fR\fR 434 .ad 435 .RS 12n 436 For disks under \fBscsi_vhci\fR(7D) control, in addition to disk \fIlun\fR 437 statistics, also report statistics for \fIlun\fR.\fIcontroller\fR. 438 .RE 439 440 .sp 441 .ne 2 442 .na 443 \fB\fB-x\fR\fR 444 .ad 445 .RS 12n 446 Report extended disk statistics. By default, disks are identified by instance 447 names such as \fBssd23\fR or \fBmd301\fR. Combining the \fBx\fR option with the 448 \fB-n\fR option causes disk names to display in the \fBcXtYdZsN\fR format, more 449 easily associated with physical hardware characteristics. Using the 450 \fBcXtYdZsN\fR format is particularly helpful in the FibreChannel environments 451 where the FC World Wide Name appears in the \fBt\fR field. 452 .sp 453 If no output display is requested (no \fB-x\fR, \fB-e\fR, \fB-E\fR), \fB-x\fR 454 is implied. 455 .RE 456 457 .sp 458 .ne 2 459 .na 460 \fB\fB-Y\fR\fR 461 .ad 462 .RS 12n 463 For disks under \fBscsi_vhci\fR(7D) control, in addition to disk \fIlun\fR 464 statistics, also report statistics for \fIlun\fR.\fItargetport\fR and 465 \fIlun\fR.\fItargetport\fR.\fIcontroller\fR. 466 .sp 467 In \fB-n\fR (descriptive) mode the \fItargetport\fR is shown in using the 468 \fBtarget-port\fR property of the path. Without \fB-n\fR the \fItargetport\fR 469 is shown using the shorter \fBport-id\fR. All target ports with the same 470 \fBtarget-port\fR property value share the same \fBport-id\fR. The 471 \fBtarget-port\fR-to-\fBport-id\fR association does not persist across reboot. 472 .sp 473 If no output display is requested (no \fB-x\fR, \fB-e\fR, \fB-E\fR), \fB-x\fR 474 is implied. 475 .RE 476 477 .sp 478 .ne 2 479 .na 480 \fB\fB-z\fR\fR 481 .ad 482 .RS 12n 483 Do not print lines whose underlying data values are all zeros. 484 .RE 485 486 .sp 487 .LP 488 The option set \fB-xcnCXTdz\fR \fIinterval\fR is particularly useful for 489 determining whether disk I/O problems exist and for identifying problems. 490 .SH OPERANDS 491 .sp 492 .LP 493 The following operands are supported: 494 .sp 495 .ne 2 496 .na 497 \fB\fIcount\fR\fR 498 .ad 499 .RS 12n 500 Display only \fIcount\fR reports. 501 .RE 502 503 .sp 504 .ne 2 505 .na 506 \fB\fIdisk\fR\fR 507 .ad 508 .RS 12n 509 Explicitly specify the disks to be reported; in addition to any explicit disks, 510 any active disks up to the disk limit (see \fB-l\fR above) will also be 511 reported. 512 .RE 513 514 .sp 515 .ne 2 516 .na 517 \fB\fIinterval\fR\fR 518 .ad 519 .RS 12n 520 Report once each \fIinterval\fR seconds. 521 .RE 522 523 .SH EXAMPLES 524 .LP 525 \fBExample 1 \fRUsing \fBiostat\fR to Generate User and System Operation 526 Statistics 527 .sp 528 .LP 529 The following command displays two reports of extended device statistics, 530 aggregated by \fIcontroller id\fR, for user (\fBus\fR) and system (\fBsy\fR) 531 operations. Because the \fB-n\fR option is used with the \fB-x\fR option, 532 devices are identified by controller names. 533 534 .sp 535 .in +2 536 .nf 537 example% \fBiostat\fR \fB-xcnCXTdz\fR \fB5\fR 538 539 540 Mon Nov 24 14:58:36 2003 541 cpu 542 us sy dt id 543 14 31 0 20 544 extended device statistics 545 r/s w/s kr/s kw wait actv wsvc_t asvc_t %w %b device 546 3.8 29.9 145.8 44.0 0.0 0.2 0.1 6.4 0 5 c0 547 666.3 814.8 12577.6 17591.1 91.3 82.3 61.6 55.6 0 2 c12 548 180.0 234.6 4401.1 5712.6 0.0 147.7 0.0 356.3 0 98 d10 549 550 Mon Nov 24 14:58:41 2003 551 cpu 552 us sy dt id 553 11 31 1 22 554 extended device statistics 555 r/s w/s kr/s kw wait actv wsvc_t asvc_t %w %b device 556 0.8 41.0 5.2 20.5 0.0 0.2 0.2 4.4 0 6 c0 557 565.3 581.7 8573.2 10458.9 0.0 26.6 0.0 23.2 0 3 c12 558 106.5 81.3 3393.2 1948.6 0.0 5.7 0.0 30.1 0 99 d10 559 .fi 560 .in -2 561 .sp 562 563 .LP 564 \fBExample 2 \fRUsing \fBiostat\fR to Generate TTY Statistics 565 .sp 566 .LP 567 The following command displays two reports on the activity of five disks in 568 different modes of operation. Because the \fB-x\fR option is used, disks are 569 identified by instance names. 570 571 .sp 572 .in +2 573 .nf 574 example% \fBiostat\fR \fB-x\fR \fBtc 5 2\fR 575 576 577 extended device statistics tty cpu 578 device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy dt id 579 sd0 0.4 0.3 10.4 8.0 0.0 0.0 36.9 0 1 0 10 0 0 0 99 580 sd1 0.0 0.0 0.3 0.4 0.0 0.0 35.0 0 0 581 sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 582 nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 583 nfs2 0.0 0.0 0.0 0.1 0.0 0.0 35.6 0 0 584 extended device statistics tty cpu 585 device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy dt id 586 sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 155 0 0 0 100 587 sd1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 588 sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 589 nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 590 nfs2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 591 592 .fi 593 .in -2 594 .sp 595 596 .LP 597 \fBExample 3 \fRUsing \fBiostat\fR to Generate Partition and Device Statistics 598 .sp 599 .LP 600 The following command generates partition and device statistics for each disk. 601 Because the \fB-n\fR option is used with the \fB-x\fR option, disks are 602 identified by controller names. 603 604 .sp 605 .in +2 606 .nf 607 example% \fBiostat -xnp\fR 608 609 extended device statistics 610 r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 611 0.4 0.3 10.4 7.9 0.0 0.0 0.0 36.9 0 1 c0t0d0 612 0.3 0.3 9.0 7.3 0.0 0.0 0.0 37.2 0 1 c0t0d0s0 613 0.0 0.0 0.1 0.5 0.0 0.0 0.0 34.0 0 0 c0t0d0s1 614 0.0 0.0 0.0 0.1 0.0 0.0 0.6 35.0 0 0 fuji:/export/home/user3 615 .fi 616 .in -2 617 .sp 618 619 .LP 620 \fBExample 4 \fRShow Translation from Instance Name to Descriptive Name 621 .sp 622 .LP 623 The following example illustrates the use of \fBiostat\fR to translate a 624 specific instance name to a descriptive name. 625 626 .sp 627 .in +2 628 .nf 629 example% \fBiostat -xn sd1\fR 630 extended device statistics 631 r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 632 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 c8t1d0 633 .fi 634 .in -2 635 .sp 636 637 .LP 638 \fBExample 5 \fRShow Target Port and Controller Activity for a Specific Disk 639 .sp 640 .LP 641 In the following example, there are four controllers, all connected to the same 642 target port. 643 644 .sp 645 .in +2 646 .nf 647 # \fBiostat -Y ssd22\fR 648 extended device statistics 649 device r/s w/s kr/s kw/s wait actv svc_t %w %b 650 ssd22 0.2 0.0 1.5 0.0 0.0 0.0 0.7 0 0 651 ssd22.t2 0.2 0.0 1.5 0.0 0.0 0.0 0.0 0 0 652 ssd22.t2.fp0 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0 653 ssd22.t2.fp1 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0 654 ssd22.t2.fp2 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0 655 ssd22.t2.fp3 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0 656 .fi 657 .in -2 658 .sp 659 660 .SH ATTRIBUTES 661 .sp 662 .LP 663 See \fBattributes\fR(5) for descriptions of the following attributes: 664 .sp 665 666 .sp 667 .TS 668 box; 669 c | c 670 l | l . 671 ATTRIBUTE TYPE ATTRIBUTE VALUE 672 _ 673 Interface Stability See below. 674 .TE 675 676 .sp 677 .LP 678 Invocation is evolving. Human readable output is unstable. 679 .SH SEE ALSO 680 .sp 681 .LP 682 \fBdate\fR(1), \fBsar\fR(1), \fBsar\fR(1M), \fBmpstat\fR(1M), \fBvmstat\fR(1M), 683 \fBtime\fR(2), \fBattributes\fR(5), \fBscsi_vhci\fR(7D) 684 .SH NOTES 685 .sp 686 .LP 687 The sum of \fBCPU\fR utilization might vary slightly from 100 because of 688 rounding errors in the production of a percentage figure. 689 .sp 690 .LP 691 The \fBsvc_t\fR response time is not particularly significant when the 692 \fBI/0\fR (\fBr/s\fR+\fBw/s\fR) rates are under 0.5 per second. Harmless spikes 693 are fairly normal in such cases. 694 .sp 695 .LP 696 The \fBmpstat\fR utility reports the same \fBdt\fR, \fBusr\fR, and \fBsys\fR 697 statistics. See \fBmpstat\fR(1M) for more information. 698 .sp 699 .LP 700 When executed in a \fBzone\fR and if the pools facility is active, 701 \fBiostat\fR(1M) will only provide information for those processors in the 702 processor set of the pool to which the \fBzone\fR is bound.