Skip to content

Troubleshooting guide

High iowait on Linux: how to find the cause

iowait is CPU time spent idle while waiting on disk. On its own it says little, but with slow requests it points squarely at storage.

3 min read10 sectionsUpdated

On this page

Key points

  • iowait is idle time, so a busy CPU can hide it.
  • await is the number that users feel.
  • %util means little on SSD and RAID devices.
  • Swapping and missing indexes are the usual root causes.

What iowait means

The metric shows the share of time a CPU had nothing to run while at least one I/O was outstanding. It is an indirect signal. Latency on the device is direct, so look there. A disk with 2 ms await is healthy regardless of the iowait percentage.

Common causes

  • Database queries scanning tables because indexes are missing.
  • Swapping when memory runs short.
  • Backups, log compaction or batch jobs.
  • Exhausted IOPS or burst credits on cloud volumes.
  • fsync heavy workloads on slow storage.

Diagnose it

Find which device is slow, then which process is responsible.

bash
# Latency per device: watch r_await, w_await, aqu-sz
iostat -xz 1 5

# Processes doing the I/O
sudo iotop -oPa -d 2 -n 5

# Is the machine swapping? (si / so columns)
vmstat 1 5

# Per-process disk stats
pidstat -d 1 5

Fixes

If a database is responsible, find its slowest queries and index them: see find slow database queries. If there is swapping, add memory or reduce usage. Move backups off peak, and use ionice -c3 for them. For a cloud volume, check whether burst balance has reached zero and provision more IOPS. Keep database, WAL and logs on separate volumes when they compete.

Reading iostat correctly

Watch r_await and w_await for the time each operation took, including queueing, and aqu-sz for how many operations are waiting. A rising queue with rising latency means the device has reached its limit. High throughput with low latency is simply a busy, healthy disk. Compare the numbers with what the volume is provisioned for: a cloud disk capped at 3,000 IOPS will show a flat line at that value while latency climbs, and that flat line is your evidence.

Catch it automatically

Alert on device latency and on cloud burst balance rather than iowait percentage. Infrastructure metrics with APM show whether slow requests line up with slow disk, which is what you need to know during an incident.

Frequently asked questions

Is high iowait always bad?

No. A batch job can cause it harmlessly. It matters when latency for your users rises too.

What is a good await on SSD?

A few milliseconds at most is typical. Sustained tens of milliseconds suggest saturation.

Why is %util 100 but performance fine?

On SSDs and arrays that serve requests in parallel, 100 percent does not mean saturated.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.