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.
iostatiostat INTERVAL — Show statistics every INTERVAL seconds, continuously.
iostat 2iostat INTERVAL COUNT — Show statistics every INTERVAL seconds, COUNT times.
iostat 2 10iostat -h — Human-readable output with unit suffixes.
iostat -hCPU Statistics
iostat -c — Show only CPU statistics.
iostat -c 1iostat -c 1 5 — Quick CPU utilization snapshot (five reports, one per second).
iostat -c 1 5Disk Statistics
iostat -d — Show only disk I/O statistics.
iostat -diostat -d DEVICE — Show statistics for a specific device.
iostat -d sdaiostat -d DEVICE1 DEVICE2 — Show statistics for multiple devices.
iostat -d sda nvme0n1iostat -p DEVICE — Show statistics for a device and all its partitions.
iostat -p sdaiostat -p ALL — Show statistics for all devices and partitions.
iostat -p ALLExtended Statistics
iostat -x — Show extended statistics: await, %util, queue sizes and more.
iostat -xiostat -xd INTERVAL — Extended disk statistics at regular intervals. Most common usage.
iostat -xd 1iostat -xd DEVICE INTERVAL — Extended stats for a specific device.
iostat -xd sda 2iostat -x -t — Extended stats with timestamps.
iostat -x -t 1Output Options
iostat -k — Show statistics in kilobytes per second.
iostat -kiostat -m — Show statistics in megabytes per second.
iostat -miostat -t — Print timestamps with each report.
iostat -t 1iostat -y INTERVAL — Skip the first (since-boot) report. Show only interval data.
iostat -y 1iostat -z — Omit inactive devices from output.
iostat -z 1iostat -o JSON — Output in JSON format.
iostat -o JSON 1 3iostat -N — Show device mapper names for LVM volumes.
iostat -NKey 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 1iostat -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
- iostat(1) man page – official reference for all options and metrics
- sysstat project – source and documentation for the sysstat package