Linux iostat: Monitor CPU and Disk IO Statistics

The iostat (Input/Output Statistics) command is a core utility within the Linux sysstat package used to monitor system input/output device loading by observing the time devices are active relative to their average transfer rates. This article explains how iostat accesses kernel-level data to generate real-time metrics, breaks down the core CPU and storage reports it produces, and demonstrates how system administrators use these statistics to diagnose hardware bottlenecks.

Where iostat Collects Its Data

iostat does not directly poll storage hardware or CPU registers. Instead, it reads counters maintained by the Linux kernel via the /proc pseudo-filesystem:

Because these /proc files contain cumulative counters accrued since system boot, iostat computes statistics by taking snapshots. The first report generated reflects averages since system startup. If an update interval is specified (e.g., iostat 2), each subsequent report calculates the delta between intervals, dividing the changes by elapsed time to show real-time rates.

CPU Statistics Explained

By default, or when using the -c flag, iostat generates a CPU report that divides processor time into distinct percentages:

Disk I/O Statistics Explained

Using the -d flag displays disk utilization, and combining it with -x reveals extended metrics necessary for performance tuning:

Essential iostat Commands