viostat command

Purpose

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.

Syntax

viostat

viostat [ -sys ] [ -adapter ] [ -tty | -disk | -extdisk ] [ -path ] [ -time ] [ PhysicalVolume ... ] [ Interval [ Count ] ]

Description

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.

Reports

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.

tty and CPU Utilization 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.

Disk Utilization Report

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.

System Throughput Report

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.

Adapter Throughput Report

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.

Disk Input/Output History

To improve performance, the collection of disk input/output statistics has been disabled. To enable the collection of this data, type:
chdev -dev sys0 -attr iostat=true
To display the current settings, type:
lsdev -dev sys0 -attr iostat
If 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.

Flags

Flag name Description
-adapter Displays the adapter throughput report.

If the -adapter flag is specified with the -tty 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.

If the -adapter flag is specified with the -disk 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.

-disk A disk header row is displayed followed by detailed statistics for each configured disk. If the PhysicalVolume parameter is specified, the statistics of the specified PhysicalVolume statistics is displayed. The -disk, -extdisk, and -tty flags are exclusive.
-extdisk A disk header row is displayed followed by detailed statistics for each configured disk. If the PhysicalVolume parameter is specified, the statistics of the specified PhysicalVolume statistics is displayed. The -disk, -extdisk, and -tty flags are exclusive.
-path The -m flag will print the path statistics for the following
  • Paths to MPIO (Multi-Path I/O) enabled devices.
  • Paths in the ESS machines.
The throughput is per device. The throughout for all the paths to that device follow the throughput of that device.

For ESS machines, the vpaths will be treated as disks and hdisks will be treated as Paths. Internally the vpaths are actually disks and hdisks are the paths to them. For MPIO enabled devices, the path name will be represented as Path0, Path1, Path2 and so on. The numbers 0, 1, 2, and so on are the path IDs provided by the lspath command. Since paths to a device can be attached to any adapter, the adapter report will report the path statistics under each adapter. The disk name will be a prefix to all the paths. For all MPIO enabled devices, the adapter report will print the path names as hdisk10_Path0, hdisk0_Path1, and so on. For all ESS Machines, the adapter report will print the path names as vpath0_hdisk3, vpath10_hdisk25, and so on.

-sys Displays the system throughput report.
-time Prints the time stamp next to each line of output of viostat. The time stamp displays in the HH:MM:SS format.
-tty The -tty flag is exclusive of the -disk flag and displays only the tty and cpu usage reports.

Examples

  1. To display a single history since boot report for all tty, CPU, and Disks, type:
    viostat
  2. To display a continuous disk report at two second intervals for the disk with the logical name disk1, type:
    viostat -disk disk1 2
  3. To display six reports at two second intervals for the disk with the logical name disk1, type:
    viostat disk1 2 6
  4. To display six reports at two second intervals for all disks, type:
    viostat -disk 2 6
  5. To display six reports at two second intervals for three disks named disk1, disk2, disk3, type:
    viostat disk1 disk2 disk3 2 6
  6. To print the System throughput report, type:
    viostat -sys
  7. To print the Adapter throughput report, type:
    viostat -adapter
  8. To print the System and Adapter throughput reports, with only the tty and CPU report (no disk reports), type:
     viostat -sys -adapter -tty
  9. To print the System and Adapter throughput reports with the Disk Utilization reports of hdisk0 and hdisk7, type
    viostat -sys -adapter -disk hdisk0 hdisk7
  10. To display time stamp next to each line of output of viostat, type:
    viostat -time



Last updated: Wed, November 18, 2020