iostat — Report CPU and Disk I/O Statistics

Practical guide to iostat — measure CPU usage and disk I/O, spot bottlenecks via await, %util and aqu-sz. Part of the sysstat package.

iostat gives you a single-glance view of how hard your CPU and storage devices are working – perfect for spotting I/O bottlenecks before they slow your applications down. The tool ships with the sysstat package and often has to be installed first. One thing to remember: the very first report is always an average since the last boot, so for current values you measure with an interval, e.g. iostat -xz 2. This guide takes you from the basics to the extended metrics such as %util, await and aqu-sz.

Basic Usage

iostat — Show CPU and disk I/O statistics since boot.

iostat

iostat INTERVAL — Show statistics every INTERVAL seconds, continuously.

iostat 2

iostat INTERVAL COUNT — Show statistics every INTERVAL seconds, COUNT times.

iostat 2 10

iostat -h — Human-readable output with unit suffixes.

iostat -h

CPU Statistics

iostat -c — Show only CPU statistics.

iostat -c 1

iostat -c 1 5 — Quick CPU utilization snapshot (five reports, one per second).

iostat -c 1 5

Disk Statistics

iostat -d — Show only disk I/O statistics.

iostat -d

iostat -d DEVICE — Show statistics for a specific device.

iostat -d sda

iostat -d DEVICE1 DEVICE2 — Show statistics for multiple devices.

iostat -d sda nvme0n1

iostat -p DEVICE — Show statistics for a device and all its partitions.

iostat -p sda

iostat -p ALL — Show statistics for all devices and partitions.

iostat -p ALL

Extended Statistics

iostat -x — Show extended statistics: await, %util, queue sizes and more.

iostat -x

iostat -xd INTERVAL — Extended disk statistics at regular intervals. Most common usage.

iostat -xd 1

iostat -xd DEVICE INTERVAL — Extended stats for a specific device.

iostat -xd sda 2

iostat -x -t — Extended stats with timestamps.

iostat -x -t 1

Output Options

iostat -k — Show statistics in kilobytes per second.

iostat -k

iostat -m — Show statistics in megabytes per second.

iostat -m

iostat -t — Print timestamps with each report.

iostat -t 1

iostat -y INTERVAL — Skip the first (since-boot) report. Show only interval data.

iostat -y 1

iostat -z — Omit inactive devices from output.

iostat -z 1

iostat -o JSON — Output in JSON format.

iostat -o JSON 1 3

iostat -N — Show device mapper names for LVM volumes.

iostat -N

Key Metrics Explained

tps — Transfers per second (I/O requests). Combined read + write operations.

kB_read/s, kB_wrtn/s — Kilobytes read/written per second.

r/s, w/s — Read/write requests per second (extended mode).

rkB/s, wkB/s — Kilobytes read/written per second (extended mode).

await — Average time (ms) for I/O requests. Includes queue time + service time.

r_await, w_await — Average time (ms) for read/write requests separately.

aqu-sz — Average queue size. High values indicate I/O saturation.

%util — Percentage of time the device was busy serving I/O requests. 100% = saturated.

rareq-sz, wareq-sz — Average read/write request size in kilobytes.

Common Patterns

iostat -xdm 1 — Real-time extended disk monitoring in MB/s. The go-to command for I/O analysis.

iostat -xdm 1

iostat -xd 1 | awk '$NF > 80' — Watch for disks with utilization above 80%.

iostat -xd 1 | awk '$NF > 80'

iostat -xdm -y 1 60 > iostat.log — Log 60 seconds of I/O stats (skip boot average).

iostat -xdm -y 1 60 > iostat.log

Conclusion

iostat is a read-only command – it changes nothing on your system, so you can run it safely on production servers. For everyday work, the one pattern worth memorising is iostat -xz 2: it hides inactive devices, prints the extended metrics and measures real interval values instead of the since-boot average. Watch %util (device saturation), await (response time including queueing) plus r/s/w/s and aqu-sz. Note that on modern SSDs and NVMe drives a high %util alone doesn't necessarily mean a bottleneck – they handle many requests in parallel, so always read await and aqu-sz alongside it.

Further Reading

  • vmstat – overview of memory, process and I/O statistics
  • top – watch processes and system load in real time
  • free – show free and used memory