On Unix-like operating systems, the iostat command reports CPU and I/O usage statistics.

This page describes the GNU/Linux version of iostat.

Description

The iostat command is used for monitoring system input/output device loading by observing the time the devices are active related to their average transfer rates. The iostat command generates reports used to change system configuration to better balance the input/output load between physical disks.

  • Description
  • Syntax
  • Examples
  • Linux commands help

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 CPU header row followed by a row of CPU statistics. On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed, followed by a line of statistics for each device that is configured.

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.

Syntax

iostat [ -c ] [ -d ] [ -h ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ] [ [ [ -T ] -g group_name ] { device […] | ALL } ] [ -p [ device [,…] | ALL ] ] [ interval [ count ] ]

Reports

The iostat command generates three types of reports: the CPU Utilization report, the Device Utilization report, and the Network Filesystem report.

CPU Utilization Report

The first report generated by the iostat command is the CPU Utilization Report. For multiprocessor systems, the CPU values are global averages among all processors. The report has the following format:

Device Utilization Report

The second report generated by the iostat command is the Device Utilization Report. The device report provides statistics on a per-physical device or partition basis. Statistics displayed for block devices and partitions may be entered on the command line. If no device or partition is entered, then statistics are displayed for every device used by the system, providing that the kernel maintains statistics for it.

If the ALL keyword is given on the command line, then statistics are displayed for every device defined by the system, including those that were never used. Transfer rates are shown in 1 K blocks by default, unless the environment variable POSIXLY_CORRECT is set, where 512 byte blocks are used. The report may show the following fields, depending on the flags used:

Options

Environment

The iostat command takes into account the following environment variables:

Examples

iostat

Display a single history-since-boot report for all CPU and Devices.

iostat -d 2

Display a continuous device report at two-second intervals.

iostat -d 2 6

Display, for all devices, six reports at two-second intervals.

iostat -x sda sdb 2 6

Display, for devices sda and sdb, six extended reports at two-second intervals.

iostat -p sda 2 6

Display six reports at two-second intervals for device sda and all partitions of device sda (sda1, sda2, etc.).