Reports Central Processing Unit (CPU) statistics, asynchronous input/output (AIO) and input/output statistics for the entire system, adapters, tty devices, disks and CD-ROMs.
viostat
viostat [ -sys ] [ -adapter ] [ -tty | -disk ] [ -path ] [ -time ] [ PhysicalVolume ... ] [ Interval [ Count ] ]
The viostat 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 viostat 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 viostat 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 viostat 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 -sys 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 -adapter 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 drive name is not found, the report lists the specified name and displays the message Drive Not Found. If no 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 viostat command generates reports continuously.
The viostat command reports number of physical processors consumed (physc) and the percentage of entitlement consumed (% entc) in shared processor environments. These metrics will only be displayed in shared processor environments.
The viostat 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 viostat 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.
The viostat 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.
The first report generated by the viostat 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:
| Statistic | 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.
The second report generated by the viostat 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:
| Statistic | Description |
|---|---|
| % 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 viostat 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 viostat command contain disk statistics collected during the report interval. Any tty and CPU statistics after boot are unaffected.
This report is generated if the -sys flag is specified. This report provides statistics for the entire system. This report has the following format:
| Statistic | Description |
|---|---|
| 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. |
This report is generated if the -adapter flag is specified. This report provides statistics on an adapter-by-adapter basis. This report has the following format:
| Statistic | Description |
|---|---|
| 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. |
chdev -dev sys0 -attr iostat=trueTo display the current settings, type:
lsdev -dev sys0 -attr iostatIf the collection of disk input/output history is disabled, the first disk report of viostat output displays the message Disk History Since Boot Not Available instead of disk statistics. As before, subsequent interval reports generated by the viostat command contain disk statistics collected during the report interval.
viostat
viostat -disk disk1 2
viostat disk1 2 6
viostat -disk 2 6
viostat disk1 disk2 disk3 2 6
viostat -sys
viostat -adapter
viostat -sys -adapter -tty
viostat -sys -adapter -disk hdisk0 hdisk7
viostat -time