The iostat utility iteratively reports terminal, disk, and tape I/O activity, as well as CPU utilization. The first line of output is for all time since boot; each subsequent line is for the prior interval only.
To compute this information, the kernel maintains a number of counters. For each disk, the kernel counts reads, writes, bytes read, and bytes written. The kernel also takes hi-res time stamps at queue entry and exit points, which allows it to keep track of the residence time and cumulative residence-length product for each queue. Using these values, iostat produces highly accurate measures of throughput, utilization, queue lengths, transaction rates and service time. For terminals collectively, the kernel simply counts the number of input and output characters.
During execution of this kernel status command, the "state" of the kernel can change. An example would be CPUs going online or offline. iostat reports this as one or more of the following messages:
device_name added device_name removed NFS_filesystem mounted NFS_filesystem unmounted cpu[s] taken offline: cpuid cpu[s] brought online: cpuid
where device_name, NFS_filesystem and cpuid are replaced with the actual name or names of the entities formatted according to other options.
The iostat utility's activity class options default to tdc (terminal, disk, and CPU). If any activity class options are specified, the default is completely overridden. Therefore, if only -d is specified, neither terminal nor CPU statistics will be reported. The last disk option specified (-d, -D, or -x) is the only one that is used.
The following options are supported:
Report the percentage of time the system has spent in user mode, in system mode, waiting for I/O, and idling.
When the -n and -x options are also selected, report extended disk statistics aggregated by controller id.
For each disk, report the number of kilobytes transferred per second, the number of transfers per second, and the average service time in milliseconds.
For each disk, report the reads per second, writes per second, and percentage disk utilization.
Display device error summary statistics. The total errors, hard errors, soft errors, and transport errors are displayed.
Display all device error statistics.
In -E output, display the "Device Id" instead of the "Serial No". The "Device Id" is a unique identifier registered by a driver through ddi_devid_register(9F).
Report the counts in each interval, rather than rates (where applicable).
Limit the number of disks included in the report to n; the disk limit defaults to 4 for -d and -D, and unlimited for -x. Note: disks explicitly requested (see disk below) are not subject to this disk limit.
Report file system mount points. This option is most useful if the -P or -p option is also specified.
Display data throughput in MB/sec instead of KB/sec.
Display names in descriptive format (for example, cXtYdZ, rmt/N, server:/export/path).
For each disk, report per-partition statistics in addition to per-device statistics.
For each disk, report per-partition statistics only, no per-device statistics.
Display data in a comma-separated format.
Suppress messages related to "state changes."
Report the number of characters read and written to terminals per second.
Display a time stamp.
For each disk, report extended disk statistics. The output is in tabular form.
For disks under scsi_vhci control, also report statistics in the form of target.controller.
Do not print lines whose underlying data values are all zeros.
The following operands are supported:
Explicitly specify the disks to be reported; in addition to any explicit disks, any active disks up to the disk limit (see -l above) will also be reported.
Display only count reports.
Report once each interval seconds.
example% iostat -xtc 5 2 extended device statistics tty cpu device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy wt id sd0 0.4 0.3 10.4 8.0 0.0 0.0 36.9 0 1 0 10 0 0 1 99 sd1 0.0 0.0 0.3 0.4 0.0 0.0 35.0 0 0 sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 nfs2 0.0 0.0 0.0 0.1 0.0 0.0 35.6 0 0 extended device statistics tty cpu device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy wt id sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 155 0 0 0 100 sd1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 nfs2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
name of the disk
reads per second
writes per second
kilobytes read per second
kilobytes written per second
average number of transactions waiting for service (queue length)
average number of transactions actively being serviced (removed from the queue but not yet completed)
average service time, in milliseconds
percent of time there are transactions waiting for service (queue non-empty)
percent of time the disk is busy (transactions in progress)
example% iostat -xnp extended device statistics r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 0.4 0.3 10.4 7.9 0.0 0.0 0.0 36.9 0 1 c0t0d0 0.3 0.3 9.0 7.3 0.0 0.0 0.0 37.2 0 1 c0t0d0s0 0.0 0.0 0.1 0.5 0.0 0.0 0.0 34.0 0 0 c0t0d0s1 0.0 0.0 0.0 0.1 0.0 0.0 0.6 35.0 0 0 expositor:/export/home3/user3
The fields have the same meanings as in the previous example, with the following additions:
average service time in wait queue, in milliseconds
average service time active transactions, in milliseconds
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
The sum of CPU utilization might vary slightly from 100 because of rounding errors in the production of a percentage figure.