A Quick Check with vmstat
vmstat 1
vmstat is part of procps and is installed on almost every system. Watch these columns for ten seconds or so:
- wa: percent of CPU time spent waiting for I/O. A few percent is normal; a high, steady value means the disk is holding the server back.
- b: processes blocked on I/O. These also raise the load average.
- bi and bo: data read from and written to block devices, in KiB per second.
- si and so: swap traffic. If these are high, the disk is busy because memory is short.
Install sysstat for iostat and pidstat
sudo apt install sysstat # Ubuntu, Debian
sudo dnf install sysstat # AlmaLinux, Rocky Linux
The package also contains mpstat and sar.
Measure Each Disk with iostat
iostat -xz 1
-x prints extended statistics, -z hides disks with no activity, and 1 repeats every second. The first report shows averages since boot; read the ones after it. Column names differ slightly between sysstat versions:
| Column | Meaning |
|---|---|
r/s, w/s | Reads and writes per second |
rkB/s, wkB/s | Data read and written per second |
r_await, w_await | Average time per request, in ms |
aqu-sz | Average queue length |
%util | Time the disk was busy |
On a virtual server the disk is usually vda or sda, on NVMe hardware nvme0n1.
What %util and await Tell You
%util is the share of time the device had at least one request in progress. The iostat manual notes that for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not show their limits. On an NVMe drive or a virtual disk, 100% does not by itself mean the disk is at its limit.
await is the average time a request took, including the time it waited in the queue. Rising await under steady load is the clearer sign of a disk that cannot keep up. Compare it with normal values on the same server rather than with a fixed number.
Find the Process with iotop
sudo apt install iotop # Ubuntu, Debian
sudo dnf install iotop # AlmaLinux, Rocky Linux 9
sudo dnf install iotop-c # AlmaLinux, Rocky Linux 10
sudo iotop -o
On version 10 the package is the C rewrite, iotop-c, which takes the same options. iotop needs root. -o shows only processes that are doing I/O now, -P shows processes instead of threads, and -a adds up I/O since iotop started, which shows steady writers that look small per second. Press q to quit.
Or Use pidstat
pidstat -d 1
pidstat from sysstat prints, per process, the kilobytes read and written per second and an I/O delay value. It works without an interactive screen, so its output can be saved to a file or pasted into a ticket.
Common Causes of Heavy Disk I/O
- Backups and archive jobs: check the time against your cron jobs.
- A database that does not fit in memory: it reads from disk what it cannot cache.
- Swapping: see how to check memory usage.
- Log floods: an application writing an error many times a second.
- A full disk: file systems slow down as they fill; see how to check disk space.
If iostat shows high await while your own read and write rates are low, collect a few minutes of iostat -xz 1 output with timestamps (-t) and send it to your hosting provider. The difference between storage types is in NVMe vs SSD.