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.
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.
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]
22 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights reserved
23 .\" Copyright (c) 2012 by Delphix. All rights reserved.
25 .TH IOSTAT 8 "Mar 23, 2009"
27 iostat \- report I/O statistics
31 \fB/usr/bin/iostat\fR [\fB-cCdDeEiImMnpPrstxXYz\fR] [\fB-l\fR \fIn\fR] [\fB-T\fR u | d]
32 [\fIdisk\fR]... [\fIinterval\fR [\fIcount\fR]]
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.
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.
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:
60 <<device removed: sd0>>
61 <<partition added: sd0,a>>
62 <<partition removed: sd0,a>>
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>>
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.
81 For more general system statistics, use \fBsar\fR(1), \fBsar\fR(8), or
86 The output of the \fBiostat\fR utility includes the following information.
120 kilobytes read per second
122 The average I/O size during the interval can be computed from \fBkr/s\fR
123 divided by \fBr/s\fR.
132 kilobytes written per second
134 The average I/O size during the interval can be computed from \fBkw/s\fR
135 divided by \fBw/s\fR.
144 average number of transactions waiting for service (queue length)
146 This is the number of I/O operations held in the device driver queue waiting
147 for acceptance by the device.
156 average number of transactions actively being serviced (removed from the queue
157 but not yet completed)
159 This is the number of I/O operations accepted, but not yet serviced, by the
169 average response time of transactions, in milliseconds
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.
186 percent of time there are transactions waiting for service (queue non-empty)
195 percent of time the disk is busy (transactions in progress)
204 average service time in wait queue, in milliseconds
213 average service time of active transactions, in milliseconds
219 The following options are supported:
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.
237 When the \fB-x\fR option is also selected, report extended disk statistics
238 aggregated by \fIcontroller id\fR.
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.
257 For each disk, report the reads per second, writes per second, and percentage
267 Display device error summary statistics. The total errors, hard errors, soft
268 errors, and transport errors are displayed.
277 Display all device error statistics.
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).
297 Report the counts in each interval, rather than rates (where applicable).
303 \fB\fB-l\fR \fIn\fR\fR
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
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
331 Display data throughput in \fBMB\fR/sec instead of KB/sec.
340 Display names in descriptive format. For example, \fBcXtYdZ\fR, \fBrmt/N\fR,
341 \fBserver:/export/path\fR.
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.
357 For each disk, report per-partition statistics in addition to per-device
367 For each disk, report per-partition statistics only, no per-device statistics.
376 Display data in a comma-separated format.
385 Suppress messages related to \fBstate changes\fR.
394 Report the number of characters read and written to terminals per second.
403 Display a time stamp.
405 Specify \fBu\fR for a printed representation of the internal representation of
406 time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
416 For disks under \fBscsi_vhci\fR(7D) control, in addition to disk \fIlun\fR
417 statistics, also report statistics for \fIlun\fR.\fIcontroller\fR.
426 Report extended disk statistics. By default, disks are identified by instance
427 names such as \fBssd23\fR or \fBmd301\fR. Combining the \fBx\fR option with the
428 \fB-n\fR option causes disk names to display in the \fBcXtYdZsN\fR format, more
429 easily associated with physical hardware characteristics. Using the
430 \fBcXtYdZsN\fR format is particularly helpful in the FibreChannel environments
431 where the FC World Wide Name appears in the \fBt\fR field.
433 If no output display is requested (no \fB-x\fR, \fB-e\fR, \fB-E\fR), \fB-x\fR
443 For disks under \fBscsi_vhci\fR(7D) control, in addition to disk \fIlun\fR
444 statistics, also report statistics for \fIlun\fR.\fItargetport\fR and
445 \fIlun\fR.\fItargetport\fR.\fIcontroller\fR.
447 In \fB-n\fR (descriptive) mode the \fItargetport\fR is shown in using the
448 \fBtarget-port\fR property of the path. Without \fB-n\fR the \fItargetport\fR
449 is shown using the shorter \fBport-id\fR. All target ports with the same
450 \fBtarget-port\fR property value share the same \fBport-id\fR. The
451 \fBtarget-port\fR-to-\fBport-id\fR association does not persist across reboot.
453 If no output display is requested (no \fB-x\fR, \fB-e\fR, \fB-E\fR), \fB-x\fR
463 Do not print lines whose underlying data values are all zeros.
468 The option set \fB-xcnCXTdz\fR \fIinterval\fR is particularly useful for
469 determining whether disk I/O problems exist and for identifying problems.
473 The following operands are supported:
480 Display only \fIcount\fR reports.
489 Explicitly specify the disks to be reported; in addition to any explicit disks,
490 any active disks up to the disk limit (see \fB-l\fR above) will also be
500 Report once each \fIinterval\fR seconds.
505 \fBExample 1 \fRUsing \fBiostat\fR to Generate User and System Operation
509 The following command displays two reports of extended device statistics,
510 aggregated by \fIcontroller id\fR, for user (\fBus\fR) and system (\fBsy\fR)
511 operations. Because the \fB-n\fR option is used with the \fB-x\fR option,
512 devices are identified by controller names.
517 example% \fBiostat\fR \fB-xcnCXTdz\fR \fB5\fR
520 Mon Nov 24 14:58:36 2003
524 extended device statistics
525 r/s w/s kr/s kw wait actv wsvc_t asvc_t %w %b device
526 3.8 29.9 145.8 44.0 0.0 0.2 0.1 6.4 0 5 c0
527 666.3 814.8 12577.6 17591.1 91.3 82.3 61.6 55.6 0 2 c12
528 180.0 234.6 4401.1 5712.6 0.0 147.7 0.0 356.3 0 98 d10
530 Mon Nov 24 14:58:41 2003
534 extended device statistics
535 r/s w/s kr/s kw wait actv wsvc_t asvc_t %w %b device
536 0.8 41.0 5.2 20.5 0.0 0.2 0.2 4.4 0 6 c0
537 565.3 581.7 8573.2 10458.9 0.0 26.6 0.0 23.2 0 3 c12
538 106.5 81.3 3393.2 1948.6 0.0 5.7 0.0 30.1 0 99 d10
544 \fBExample 2 \fRUsing \fBiostat\fR to Generate TTY Statistics
547 The following command displays two reports on the activity of five disks in
548 different modes of operation. Because the \fB-x\fR option is used, disks are
549 identified by instance names.
554 example% \fBiostat\fR \fB-x\fR \fBtc 5 2\fR
557 extended device statistics tty cpu
558 device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy dt id
559 sd0 0.4 0.3 10.4 8.0 0.0 0.0 36.9 0 1 0 10 0 0 0 99
560 sd1 0.0 0.0 0.3 0.4 0.0 0.0 35.0 0 0
561 sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
562 nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
563 nfs2 0.0 0.0 0.0 0.1 0.0 0.0 35.6 0 0
564 extended device statistics tty cpu
565 device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy dt id
566 sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 155 0 0 0 100
567 sd1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
568 sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
569 nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
570 nfs2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
577 \fBExample 3 \fRUsing \fBiostat\fR to Generate Partition and Device Statistics
580 The following command generates partition and device statistics for each disk.
581 Because the \fB-n\fR option is used with the \fB-x\fR option, disks are
582 identified by controller names.
587 example% \fBiostat -xnp\fR
589 extended device statistics
590 r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
591 0.4 0.3 10.4 7.9 0.0 0.0 0.0 36.9 0 1 c0t0d0
592 0.3 0.3 9.0 7.3 0.0 0.0 0.0 37.2 0 1 c0t0d0s0
593 0.0 0.0 0.1 0.5 0.0 0.0 0.0 34.0 0 0 c0t0d0s1
594 0.0 0.0 0.0 0.1 0.0 0.0 0.6 35.0 0 0 fuji:/export/home/user3
600 \fBExample 4 \fRShow Translation from Instance Name to Descriptive Name
603 The following example illustrates the use of \fBiostat\fR to translate a
604 specific instance name to a descriptive name.
609 example% \fBiostat -xn sd1\fR
610 extended device statistics
611 r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
612 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 c8t1d0
618 \fBExample 5 \fRShow Target Port and Controller Activity for a Specific Disk
621 In the following example, there are four controllers, all connected to the same
627 # \fBiostat -Y ssd22\fR
628 extended device statistics
629 device r/s w/s kr/s kw/s wait actv svc_t %w %b
630 ssd22 0.2 0.0 1.5 0.0 0.0 0.0 0.7 0 0
631 ssd22.t2 0.2 0.0 1.5 0.0 0.0 0.0 0.0 0 0
632 ssd22.t2.fp0 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0
633 ssd22.t2.fp1 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0
634 ssd22.t2.fp2 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0
635 ssd22.t2.fp3 0.0 0.0 0.4 0.0 0.0 0.0 0.0 0 0
643 See \fBattributes\fR(5) for descriptions of the following attributes:
651 ATTRIBUTE TYPE ATTRIBUTE VALUE
653 Interface Stability See below.
658 Invocation is evolving. Human readable output is unstable.
662 \fBdate\fR(1), \fBsar\fR(1), \fBsar\fR(8), \fBmpstat\fR(8), \fBvmstat\fR(8),
663 \fBtime\fR(2), \fBattributes\fR(5), \fBscsi_vhci\fR(7D)
667 The sum of \fBCPU\fR utilization might vary slightly from 100 because of
668 rounding errors in the production of a percentage figure.
671 The \fBsvc_t\fR response time is not particularly significant when the
672 \fBI/0\fR (\fBr/s\fR+\fBw/s\fR) rates are under 0.5 per second. Harmless spikes
673 are fairly normal in such cases.
676 The \fBmpstat\fR utility reports the same \fBdt\fR, \fBusr\fR, and \fBsys\fR
677 statistics. See \fBmpstat\fR(8) for more information.
680 When executed in a \fBzone\fR and if the pools facility is active,
681 \fBiostat\fR(8) will only provide information for those processors in the
682 processor set of the pool to which the \fBzone\fR is bound.