Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

iostat Command Guide for CPU and Disk IO Statistics

iostat reports CPU and input/output (disk) statistics per device — and its single most important column is %util, which tells you how busy each disk actually is.


What is iostat?, and Why Use It?

iostat is part of the sysstat package and answers one focused question: what are my disks (and my CPU) doing? For each block device it prints throughput, IOPS, wait times, and utilization — the numbers that tell you whether a “slow server” is really a slow disk.

It complements vmstat, which sees disk activity only as anonymous blocks-in/blocks-out totals. iostat breaks that down per device (sda, nvme0n1, …), so when vmstat shouts “disk is busy”, iostat tells you which disk and how busy — the difference between a failing drive and a database doing its job.

Why Learn iostat?

  • It names the guilty device — on a multi-disk server, “the disk is slow” is useless; sda at 99% util is actionable.
  • It measures what matters for disks — service times (await/r_await, w_await), IOPS, and throughput, not just vague block counts.
  • It is the standard answer to “is my disk the bottleneck?” — %util and aqu-sz settle arguments about storage performance instantly.
  • It ships with the OS on most distros — after a one-line package install (sysstat), it works on every server you will ever SSH into.

“%util near 100 means the device can’t keep up with the requests coming at it — that, not throughput alone, is the saturation signal.”


1. Run It and Read the Output

iostat
Linux 6.6.0 (server) 	12/05/2026 	_x86_64_	(4 CPU)

avg-cpu:  %user   %nice  %system %iowait  %steal   %idle
           5.20    0.00    3.10    1.40    0.00   90.30

Device             tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda               12.3        96.00       412.00   1234567   8901234
nvme0n1          88.0       512.00       220.00   4455667   7788990

Run bare, iostat prints two things: an avg-cpu block (CPU split since boot) and a per-device table (also averages since boot). Like the first row of vmstat, the bare output describes the whole uptime — useful for a quick overall picture, wrong for judging “right now”.

For a live view, pass an interval — and note the interval form prints repeated avg-cpu + device sections:

iostat 2
avg-cpu:  %user   %nice  %system %iowait  %steal   %idle
           7.10    0.00    4.20    2.30    0.00   86.40

Device             r/s     w/s   rkB/s   wkB/s  rrqm/s  ...  %util
sda             120.00   340.00  960.00 4120.00    0.10  ...  61.20
nvme0n1         400.00   510.00 5120.00 2200.00    0.00  ...  33.80
  • 2 — print a fresh report every 2 seconds until Ctrl-C.

Column names differ by sysstat version (older: tps, kB_read/s; newer: r/s, rkB/s); the meanings below are the same.

2. The Extended View: -x

The default columns hide the most useful timing data. -x expands the report:

iostat -x 2
Device   r/s     w/s   r_await  w_await  aqu-sz  %util
sda    120.00  340.00     0.40    12.30    4.30  99.20
nvme0n1 400.00 510.00     0.10     0.20    0.30  33.80
ColumnMeaning
r/s, w/sRead/writes per second (IOPS)
rkB/s, wkB/sRead/write throughput in KiB per second
r_await, w_awaitAverage wait per IO, in milliseconds — latency you feel as slowness
aqu-sz (older: avgqu-sz)Average queue depth — how many requests are waiting
%utilFraction of elapsed time the device had at least one request in flight

Read it like a doctor: sda answers 460 requests/second, each write waits ~12 ms, 4 requests queue up on average, and the device is busy 99% of the time. That disk is saturated. nvme0n1 by contrast is fast and relaxed.

3. Judge Saturation Correctly

%util is the headline number, but it needs care:

# Watch only the extended device stats, 1-second refresh
iostat -x 1
  • Spinning disk (HDD/SATA): %util near 100 really does mean saturated — one request at a time is the device’s nature.
  • NVMe/SSD: these handle many requests in parallel, so a device can show 100% util while barely breaking a sweat. Judge NVMe by r_await/w_await and queue depth instead — 0.1 ms latency at 100% util is fine.
  • Sustained await in the tens of milliseconds on an SSD (or hundreds on an HDD) plus a queue > 1 is the real “disk is your bottleneck” signal.

Cross-check the symptom from the other side: if vmstat shows a rising wa (IO wait) column, iostat -x should show the device responsible.

4. Show Only What You Care About

Servers have many devices (sda, sdb, nvme0n1p1, …). Filter to one:

# Stats for sda only, every second
iostat -x sda 1

# Exclude the noisy loop devices
iostat -x -pLoop 1

Other common filters and flags:

CommandWhat it does
iostat -c 1CPU stats only, no device table
iostat -d 1Device stats only, no CPU block
iostat -p ALL 1Also report per-partition stats (e.g., sda1)
iostat -h 1Human-readable units (MB/s instead of kB/s) where supported

5. Use It When a Backup or Build Feels Slow

A concrete workflow — “the nightly backup crawls; is the disk the problem?”:

# Terminal 1: watch the disk live
iostat -x 2

If during the backup wkB/s climbs but %util stays at 30% with w_await under 1 ms, the disk is not the bottleneck — look at the network or the backup tool. If instead w_await spikes to 50 ms and aqu-sz climbs above 4, the disk is drowning: either the workload exceeds the hardware, or the device is failing (check health with smartctl, not iostat).

Pair the finding with dmesg — a dying disk shows up in the kernel log with IO errors long before tools report latency.


Common Pitfalls

  • Running bare iostat for a live check — without an interval it prints boot-time averages; you want iostat -x 1.
  • Reading %util alone on NVMe — parallel devices can be 100% busy and fast; trust await and queue depth on SSDs.
  • Confusing throughput with saturation — a device moving lots of MB/s at low latency is healthy; the problem signal is high await with a growing queue.
  • Blaming the disk for everything — high wkB/s during a legitimate backup is normal; iostat says the disk is busy, not that anything is wrong.
  • Forgetting iostat needs sysstat — on a minimal install it is not there yet; install the package first (see the Packages section).
PageRelationship
vmstatSystem-wide IO summary — the “is disk involved?” first pass
freeMemory health — swap thrash and disk slowness feel alike
dmesgKernel log — where failing disks announce themselves
journalctlSystemd logs — IO errors from services
dfDisk space — a different disk question entirely

iostat Cheatsheet

CommandWhat it does
iostatCPU + per-device averages since boot
iostat -x 1The everyday command: extended stats, refreshed every second
iostat -x sda 1One device only, live
iostat -c 1 / iostat -d 1CPU-only or devices-only report
iostat -p ALL 1Include per-partition rows
%utilPercent of time the device had work in flight (HDD: saturation signal)
r_await / w_awaitAverage IO latency in ms — the real slowness measure
aqu-szAverage queue depth — sustained values above 1 on a busy disk mean backlog