iostat — Disk I/O Statistics
iostat reports CPU and disk I/O statistics, including throughput and (with extended mode) useful latency/utilization fields. Use it when WordPress pages are slow and you suspect storage is the bottleneck (slow database writes, heavy backups, log storms). High %util and high await during the problem window are common signals of I/O saturation.
Run iostat -xz 1 5 during a slow period. Look for high await and %util on the device backing /var/www or /var/lib/mysql.
Mental Model
Prerequisites
iostat is provided by the sysstat package.
Install it:
- Ubuntu / Debian
- CentOS / RHEL
sudo apt update
sudo apt install -y sysstat
sudo dnf install -y sysstat
Verify:
which iostat
iostat -V
Core Syntax
iostat [options] [interval [count]]
Key Options
| Option | What it does | Example | WordPress / VPS use case |
|---|---|---|---|
-x | Extended stats (latency/util) | iostat -x | Needed for await and %util |
-z | Hide idle devices | iostat -xz 1 5 | Reduce noise |
-y | Skip first report | iostat -y -xz 1 5 | First report is since boot |
-d | Device report only | iostat -dx 1 5 | Focus on disks |
-c | CPU report only | iostat -c 1 5 | CPU vs disk triage |
-p ALL | Include partitions | iostat -xz -p ALL 1 5 | Identify a hot partition |
-m | MB/s units | iostat -xm 1 5 | Easier throughput reading |
-t | Add timestamp | iostat -xz -t 1 5 | Correlate with logs |
-o JSON | JSON output | iostat -o JSON 1 1 | Automation |
Examples (Commands + Expected Output)
Field names can vary by sysstat version and kernel.
Basic report
iostat
Expected output:
avg-cpu: %user %nice %system %iowait %steal %idle
10.00 0.00 3.00 1.00 0.00 86.00
Device tps kB_read/s kB_wrtn/s
sda 20.0 120.0 240.0
Use case: Quick split between CPU usage and disk activity.
Extended device stats (recommended)
iostat -xz 1 3
Expected output:
Device r/s w/s rkB/s wkB/s await %util
sda 5.0 15.0 120.0 240.0 8.0 60.0
Use case: Check latency (await) and saturation (%util) while WordPress is slow.
Devices only (no CPU section)
iostat -dx 1 3
Expected output:
Device r/s w/s rkB/s wkB/s await %util
sda 5.0 15.0 120.0 240.0 8.0 60.0
Use case: Focus on storage during disk bottleneck triage.
Include partitions
iostat -xz -p ALL 1 3
Expected output:
Device r/s w/s rkB/s wkB/s await %util
sda1 4.0 10.0 100.0 200.0 7.0 55.0
sda2 1.0 5.0 20.0 40.0 12.0 70.0
Use case: Identify which partition is hot (WordPress vs database vs logs).
Add timestamps
iostat -xz -t 1 3
Expected output:
03/01/2026 10:40:01
Device r/s w/s rkB/s wkB/s await %util
sda 5.0 15.0 120.0 240.0 8.0 60.0
Use case: Correlate I/O spikes with cron jobs and backups.
JSON output
iostat -o JSON 1 1
Expected output:
{"sysstat":{"hosts":[{"statistics":[{"disk":[{"disk_device":"sda","await":8.0,"util":60.0}]}]}]}}}
Use case: Parse in automation.
WordPress VPS Use Cases
| Symptom | What to watch | Command | Interpretation |
|---|---|---|---|
| Slow page loads | High await and %util | iostat -xz 1 5 | Disk is saturated or slow |
| Slow DB queries | Hot DB device/partition | iostat -xz -p ALL 1 5 | Database volume is bottleneck |
| Backups cause site slowdown | I/O spikes during backup window | iostat -xz -t 1 20 | Schedule/limit backups |
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
iostat: command not found | sysstat not installed | Install sysstat |
| Misleading first report | First output is since boot | Use -y or look at later samples |
High await but low %util | Device latency or queue behavior | Sample longer; correlate with workload |
Best Practices
- Sample multiple times (
interval count) and focus on trends. - Pair
iostatwithfindmnt -T PATHto confirm which device backs the path you're troubleshooting. - If
%utilstays near 100% during slow periods, consider faster storage or workload reduction.
Cheat Sheet
iostat
iostat -xz 1 5
iostat -y -xz 1 5
iostat -dx 1 5
iostat -xz -p ALL 1 5
iostat -xz -t 1 5
iostat -o JSON 1 1