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
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.
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.
Related reading
- High CPU usage on a Linux server: find the cause: Diagnose high CPU on a Linux server: read top, load, steal and iowait, find the busy process and thread, profile it and spot throttling.
- PostgreSQL high CPU usage: how to find the cause: Diagnose PostgreSQL high CPU: use pg_stat_statements to rank queries by total time, spot missing indexes and stale statistics, and read EXPLAIN properly.
- 500 Internal Server Error: how to find the cause: A 500 error means your code failed. Find the exception behind it fast with logs, traces and error tracking, and learn how to prevent repeats.
- No space left on device on Linux: how to fix it: Fix "No space left on device" on Linux: find large files, deleted files still open by processes, and inode exhaustion, with safe commands for a production host.
- Prometheus high cardinality: how to find and fix it: Find and fix Prometheus high cardinality: use the TSDB status page and promtool, identify runaway labels and drop them with relabeling rules before ingestion.
- Java high CPU: how to find the thread with a thread dump: Find which Java thread causes high CPU: match top -H thread IDs against jstack output, read thread states, spot GC problems and use async-profiler safely.
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.