Use the iostat command to report statistics about disk input and output, and to produce measures of throughput, utilization, queue lengths, transaction rates, and service time. For a detailed description of this command, refer to the iostat(1M) man page.
You can display disk utilization information by using the iostat command with a time interval in seconds.
$ iostat 5 tty fd0 sd3 nfs1 nfs31 cpu tin tout kps tps serv kps tps serv kps tps serv kps tps serv us sy wt id 0 1 0 0 410 3 0 29 0 0 9 3 0 47 4 2 0 94 |
The first line of output shows the statistics since the last time the system was booted. Each subsequent line shows the interval statistics. The default is to show statistics for the terminal (tty), disks (fd and sd), and CPU (cpu).
The following example shows disk statistics that were gathered every five seconds.
$ iostat 5 tty sd0 sd6 nfs1 nfs49 cpu tin tout kps tps serv kps tps serv kps tps serv kps tps serv us sy wt id 0 0 1 0 49 0 0 0 0 0 0 0 0 15 0 0 0 100 0 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 44 6 132 0 0 0 0 0 0 0 0 0 0 0 1 99 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 3 1 23 0 0 0 0 0 0 0 0 0 0 0 1 99 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 |
The following table describes the fields in the output of the iostat n command.
Device Type |
Field Name |
Description |
---|---|---|
Terminal |
Device Type | |
tin |
Number of characters in the terminal input queue |
|
tout |
Number of characters in the terminal output queue |
|
Disk |
Device Type | |
bps |
Blocks per second |
|
tps |
Transactions per second |
|
serv |
Average service time, in milliseconds |
|
CPU |
Device Type | |
us |
In user mode |
|
sy |
In system mode |
|
wt |
Waiting for I/O |
|
id |
Idle |
Run the iostat -xtc command to display extended disk statistics.
$ iostat -xtc 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 fd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 0 0 0 0 100 sd0 0.0 0.0 0.4 0.4 0.0 0.0 49.5 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 nfs49 0.0 0.0 0.0 0.0 0.0 0.0 15.1 0 0 nfs53 0.0 0.0 0.4 0.0 0.0 0.0 24.5 0 0 nfs54 0.0 0.0 0.0 0.0 0.0 0.0 6.3 0 0 nfs55 0.0 0.0 0.0 0.0 0.0 0.0 4.9 0 0 |
The iostat -xtc command displays a line of output for each disk. The output fields are described in the following list.
Reads per second
Writes per second
Kbytes read per second
Kbytes written per second
Average number of transactions that are waiting for service (queue length)
Average number of transactions that are actively being serviced
Average service time, in milliseconds
Percentage of time that the queue is not empty
Percentage of time that the disk is busy