Andrew Mercer
on this page

Usage

iostat comes with sysstat.

iostat                     # averages since boot
iostat -xz 1               # extended stats, hide idle devices, every second
iostat -xm 5 3             # MB/s units, 5-second interval, 3 reports
iostat -p sda 1            # one disk and its partitions
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          15.99    0.05   11.69    0.05    0.00   72.23

Device   tps   kB_read/s   kB_wrtn/s   kB_dscd/s   kB_read   kB_wrtn   kB_dscd
nvme0n1  5.50       8.54      100.50      281.70   5274947  62110404  174088844

The first report is the average since boot, which usually hides the current situation. Always take at least two samples and ignore the first.

Key fields (with -x)

Field Meaning
tps I/O requests per second to the device
rkB/s, wkB/s throughput
r/s, w/s completed reads/writes per second (after merging)
rrqm/s, wrqm/s requests merged per second
r_await, w_await average time in ms a request takes, including queue wait
aqu-sz (older: avgqu-sz) average queue length
%util share of time the device had I/O in flight

How to read it:

  • %util near 100% means a spinning disk is saturated. On SSD/NVMe, which service many requests in parallel, %util can read 100% long before the device is truly out of capacity, so look at await and queue size instead.
  • Rising await with a growing queue is the signature of a device that cannot keep up.
  • svctm was removed in recent sysstat versions because it was unreliable. Ignore it if you see it.

Which process is responsible? Use iotop. Deeper traces: blktrace. Load generation: fio.