-------------------------------------------------------------------------------
Commands Reference, Volume 3
-------------------------------------------------------------------------------
iostat Command
Purpose
Reports Central Processing Unit (CPU) statistics and input/output statistics for
the entire system, adapters, tty devices, disks and CD-ROMs.
Syntax
iostat [ -s ] [ -a ] [ -d | -t ] [ PhysicalVolume ... ] [ Interval [ Count ] ]
Description
The iostat command is used for monitoring system input/output device loading by
observing the time the physical disks are active in relation to their average
transfer rates. The iostat command generates reports that can be used to change
system configuration to better balance the input/output load between physical
disks and adapters.
The first report generated by the iostat command provides statistics concerning
the time since the system was booted. Each subsequent report covers the time
since the previous report. All statistics are reported each time the iostat
command is run. The report consists of a tty and CPU header row followed by a
row of tty and CPU statistics. On multiprocessor systems, CPU statistics are
calculated system-wide as averages among all processors.
If the -s flag is specified, a system-header row is displayed followed by a line
of statistics for the entire system. The hostname of the system is printed in
the system-header row.
If the -a flag is specified, an adapter-header row is displayed followed by a
line of statistics for the adapter. This will be followed by a disk-header row
and the statistics of all the disks/CD-ROMs connected to the adapter. Such
reports are generated for all the disk adapters connected to the system.
A disks header row is displayed followed by a line of statistics for each disk
that is configured. If the PhysicalVolume parameter is specified, only those
names specified are displayed.
If the PhysicalVolume parameter is specified, one or more alphabetic or
alphanumeric physical volumes can be specified. If the PhysicalVolume parameter
is specified, the tty and CPU reports are displayed and the disk report contains
statistics for the specified drives. If a specified logical drive name is not
found, the report lists the specified name and displays the message Drive Not
Found. If no Logical Drive Names are specified, the report contains statistics
for all configured disks and CD-ROMs. If no drives are configured on the system,
no disk report is generated. The first character in the PhysicalVolume parameter
cannot be numeric.
The Interval parameter specifies the amount of time in seconds between each
report. The first report contains statistics for the time since system startup
(boot). Each subsequent report contains statistics collected during the interval
since the previous report. The Count parameter can be specified in conjunction
with the Interval parameter. If the Count parameter is specified, the value of
count determines the number of reports generated at Interval seconds apart. If
the Interval parameter is specified without the Count parameter, the iostat
command generates reports continuously.
The iostat command is useful in determining whether a physical volume is
becoming a performance bottleneck and if there is potential to improve the
situation. The % utilization field for the physical volumes indicates how evenly
the file activity is spread across the drives. A high % utilization on a
physical volume is a good indication that there may be contention for this
resource. Since the CPU utilization statistics are also available with the
iostat report, the percentage of time the CPU is in I/O wait can be determined
at the same time. Consider distributing data across drives if the I/O wait time
is significant and the disk utilization is not evenly distributed across
volumes.
Note: Some system resource is consumed in maintaining disk I/O history for
the iostat command. Use the sysconfig subroutine, or the System Management
Interface Tool (SMIT) to stop history accounting.
Reports
The iostat command generates four types of reports, the tty and CPU Utilization
report, the Disk Utilization report, the System throughput report and the
Adapter throughput report.
tty and CPU Utilization Report
The first report generated by the iostat command is the tty and CPU Utilization
Report. For multiprocessor systems, the CPU values are global averages among all
processors. Also, the I/O wait state is defined system-wide and not per
processor. The report has the following format:
Column Description
tin Shows the total number of characters read by the system for all ttys.
tout Shows the total number of characters written by the system to all ttys.
% user Shows the percentage of CPU utilization that occurred while executing at
the user level (application).
% sys Shows the percentage of CPU utilization that occurred while executing at
the system level (kernel).
% idle Shows the percentage of time that the CPU or CPUs were idle and the
system did not have an outstanding disk I/O request.
% iowait Shows the percentage of time that the CPU or CPUs were idle during
which the system had an outstanding disk I/O request.
This information is updated at regular intervals by the kernel (typically sixty
times per second). The tty report provides a collective account of characters
per second received from all terminals on the system as well as the collective
count of characters output per second to all terminals on the system.
Methods Used to Compute CPU Disk I/O Wait Time
Operating system version 4.3.3 and later contain enhancements to the method used
to compute the percentage of CPU time spent waiting on disk I/O (wio time).The
method used in AIX 4.3.2 and earlier versions of the operating system can, under
certain circumstances, give an inflated view of wio time on SMPs. The wio time
is reported by the commands sar (%wio), vmstat (wa) and iostat (% iowait).
The method used in AIX 4.3.2 and earlier versions is as follows: At each clock
interrupt on each processor (100 times a second per processor), a determination
is made as to which of the four categories (usr/sys/wio/idle) to place the last
10 ms of time. If the CPU was busy in usr mode at the time of the clock
interrupt, then usr gets the clock tick added into its category. If the CPU was
busy in kernel mode at the time of the clock interrupt, then the sys category
gets the tick. If the CPU was not busy, a check is made to see if any I/O to
disk is in progress. If any disk I/O is in progress, the wio category is
incremented. If no disk I/O is in progress and the CPU is not busy, the idle
category gets the tick. The inflated view of wio time results from all idle CPUs
being categorized as wio regardless of the number of threads waiting on I/O. For
example, systems with just one thread doing I/O could report over 90 percent wio
time regardless of the number of CPUs it has.
The method used in AIX 4.3.3 and later is as follows: The change in operating
system version 4.3.3 is to only mark an idle CPU as wio if an outstanding I/O
was started on that CPU. This method can report much lower wio times when just a
few threads are doing I/O and the system is otherwise idle. For example, a
system with four CPUs and one thread doing I/O will report a maximum of 25
percent wio time. A system with 12 CPUs and one thread doing I/O will report a
maximum of 8 percent wio time. NFS client reads/writes go through the VMM, and
the time that biods spend in the VMM waiting for an I/O to complete is now
reported as I/O wait time.
Disk Utilization Report
The second report generated by the iostat command is the Disk Utilization
Report. The disk report provides statistics on a per physical disk basis. The
report has a format similar to the following:
% tm_act Indicates the percentage of time the physical disk was active
(bandwidth utilization for the drive).
Kbps Indicates the amount of data transferred (read or written) to the drive in
KB per second.
tps Indicates the number of transfers per second that were issued to the
physical disk. A transfer is an I/O request to the physical disk. Multiple
logical requests can be combined into a single I/O request to the disk. A
transfer is of indeterminate size.
Kb_read The total number of KB read.
Kb_wrtn The total number of KB written.
Statistics for CD-ROM devices are also reported.
For large system configurations where a large number of disks are configured,
the system can be configured to avoid collecting physical disk input/output
statistics when the iostat command is not executing. If the system is configured
in the above manner, the first Disk report displays the message Disk History
Since Boot Not Available instead of the disk statistics. Subsequent interval
reports generated by the iostat command contain disk statistics collected during
the report interval. Any tty and CPU statistics after boot are unaffected. If a
system management command is used to re-enable disk statistics keeping, the
first iostat command report displays activity from the interval starting at the
point that disk input/output statistics were enabled.
System Throughput Report
This report is generated if the -s flag is specified. This report provides
statistics for the entire system. This report has the following format:
Kbps Indicates the amount of data transferred (read or written) in the entire
system in KB per second.
tps Indicates the number of transfers per second issued to the entire system.
Kb_read The total number of KB read from the entire system.
Kb_wrtn The total number of KB written to the entire system.
Adapter Throughput Report
This report is generated if the -a flag is specified. This report provides
statistics on an adapter-by-adapter basis.This report has the following format:
Kbps Indicates the amount of data transferred (read or written) in the adapter
in KB per second.
tps Indicates the number of transfers per second issued to the adapter.
Kb_read The total number of KB read from the adapter.
Kb_wrtn The total number of KB written to the adapter.
Disk Input/Output History
To improve performance on, the collection of disk input/output statistics has
been disabled. To enable the collection of this data, enter:
chdev -l sys0 -a iostat=true
To display the current settings, enter:
lsattr -E -l sys0 -a iostat
If the collection of disk input/output history is disabled, the first disk
report of iostat output displays the message Disk History Since Boot Not
Available instead of disk statistics. As before, subsequent interval reports
generated by the iostat command contain disk statistics collected during the
report interval.
Flags
-a Displays the adapter throughput report.
-d The -d flag is exclusive of the -t flag and displays only the disk
utilization report.
-s Displays the system throughput report.
-t The -t flag is exclusive of the -d flag and displays only the tty and cpu
usage reports.
Notes:
o The -s and -a flags can both be specified to display both the system and
adapter throughput reports.
o If the -a flag is specified with the -t flag, the tty and CPU report is
displayed, followed by the adapter throughput report. Disk Utilization
reports of the disks connected to the adapters, will not be displayed
after the Adapter throughput report.
o If the -a flag is specified with the -d flag, tty and CPU report will
not be displayed. If Physical Volume parameter is specified, the Disk
Utilization Report of the specified Physical volume will be printed
under the corresponding adapter to which it belongs.
Examples
1. To display a single history since boot report for all tty, CPU, and Disks,
enter:
iostat
2. To display a continuous disk report at two second intervals for the disk
with the logical name disk1, enter:
iostat -d disk1 2
3. To display six reports at two second intervals for the disk with the
logical name disk1, enter:
iostat disk1 2 6
4. To display six reports at two second intervals for all disks, enter:
iostat -d 2 6
5. To display six reports at two second intervals for three disks named disk1,
disk2, disk3, enter:
iostat disk1 disk2 disk3 2 6
6. To print the System throughput report, enter:
iostat -s
7. To print the Adapter throughput report, enter:
iostat -a
8. To print the System and Adapter throughput reports, with only the tty and
CPU report (no disk reports), enter:
iostat -sat
9. To print the System and Adapter throughput reports with the Disk
Utilization reports of hdisk0 and hdisk7, enter
iostat -sad hdisk0 hdisk7
File
/usr/bin/iostat Contains the iostat command.
Related Information
The vmstat command.
The /dev/kmem special file.
The knlist subroutine, sysconfig subroutine.
Monitoring and Tuning Disk I/O in AIX 5L Version 5.1 Performance Management
Guide
The Input and Output Handling Programmer's Overview in AIX 5L Version 5.1
General Programming Concepts: Writing and Debugging Programs describes the
files, commands, and subroutines used for low-level, stream, terminal, and
asynchronous I/O interfaces.
-------------------------------------------------------------------------------