LinuxCommandLibrary

iostat

Report CPU and I/O statistics

TLDR

Display a report of CPU and disk statistics since system startup

$ iostat
copy

Display a report of CPU and disk statistics with units converted to megabytes
$ iostat -m
copy

Display CPU statistics
$ iostat -c
copy

Display disk statistics with disk names (including LVM)
$ iostat -N
copy

Display extended disk statistics with disk names for device "sda"
$ iostat -xN [sda]
copy

Display incremental reports of CPU and disk statistics every 2 seconds
$ iostat [2]
copy

SYNOPSIS

iostat [ options ] [ [ ] ] [ ... ]

PARAMETERS

-c
    Display CPU utilization report.

-d
    Display disk utilization report.

-N
    Display registered device mapper names.

-n name
    Display statistics for network filesystems (NFS).

-p [ device ]
    Display statistics for block devices and all their partitions.

-t
    Print the time for each report displayed.

-V
    Print version and exit.

-x
    Display extended statistics.

-y
    Omit first report with possibly incomplete statistics.

-z
    Omit reports with no activity.


    Sampling interval in seconds.


    Number of reports to generate.


    Specific device to report statistics for.

DESCRIPTION

iostat is a system monitoring tool used to report Central Processing Unit (CPU) statistics and input/output (I/O) statistics for block devices and partitions. It is often used to identify performance bottlenecks related to disk I/O. The tool collects data over a specific time interval and presents it in a user-friendly format, showing statistics such as read/write speeds, disk utilization, and CPU usage.

It is part of the sysstat package, meaning you might need to install this package on your Linux system to use iostat. The reports generated by iostat can be used to tune system performance by understanding how efficiently data is transferred between the operating system and storage devices. By monitoring I/O activity, administrators can pinpoint slow or overloaded disks, which can lead to overall system slowdowns. The tool allows for customization, providing options to report statistics for specific devices, display extended statistics, and adjust the reporting interval.

CAVEATS

The first report generated by iostat may contain incomplete or misleading statistics, especially shortly after boot. Using the -y option is recommended to suppress the first report.

INTERPRETING OUTPUT

The output of iostat includes various metrics, such as 'tps' (transfers per second), 'kB_read/s' (kilobytes read per second), 'kB_wrtn/s' (kilobytes written per second), '%iowait' (percentage of time the CPU is waiting for I/O operations), and '%util' (percentage of time the device is busy). Understanding these metrics is crucial for identifying and resolving I/O-related performance issues.

HISTORY

iostat's origins trace back to early Unix systems. It has been continually developed and improved over the years, with the primary goal of providing detailed insights into system I/O performance. Originally a simple tool for monitoring disk activity, it has evolved to include more comprehensive CPU and device statistics. The tool's inclusion in the sysstat package ensures its widespread availability and ongoing maintenance on modern Linux distributions.

SEE ALSO

vmstat(8), sar(1)

Copied to clipboard