iostat — disk I/O statistics
💬 "iostat command"
iostat shows per-disk I/O throughput and latency. It identifies storage bottlenecks.
Pay particular attention to %util and await (latency).
- tps: number of I/O requests per second.
- kB_read/s, kB_wrtn/s: read/write volume per second.
- await: average wait time (ms). A high value indicates a bottleneck.
- %util: device utilization. Close to 100% means saturation.
Frequently used options
| Option | Description |
|---|---|
| -x | Displays extended statistics (await, %util) |
| <interval> <count> | Example: iostat -x 1 5 |
| -d | Displays disk statistics only |
| -m | Displays in MB units |
3 essential command combinations
iostat -x 1 3— observe extended per-disk statisticsiostat -xm 1 3 | grep -E 'Device|vdb'— view only a specific diskiostat -d -m 1 3— check throughput in MB units
💬 "Show me an example of saving this command's output to a file"
Here are common situations on live production servers, organized step by step.
Step 1 · Observe statistics
View extended statistics for a few seconds.
iostat -x 1 3
Step 2 · Identify saturated devices
Find devices with high %util and await.
iostat -x 1 3 | awk '$1=="vdb"'
Step 3 · Find the culprit process
Find the process using that device.
iotop -o -b -n 1 2>/dev/null | head || ps -eo pid,comm | head
How it is used in practice
1. Diagnosing disk saturation
Situation — service is slow and wa is high.
iostat -x 1 3
Result — a device with %util close to 100% and high await is observed.
Point — find processes concentrated on that device and distribute the load.
2. Determining a backup time window
Situation — find a time window when backups will not affect the service.
iostat -xm 1 5
Result — compare throughput by time window and choose a window with spare capacity.
Point — schedule backups during periods with low kB_wrtn/s.
Things to watch out for
- The first measurement is an average, so ignore it and look at the subsequent values.
- Virtual/cloud disks have different latency characteristics, so be careful when interpreting the numbers.
- If additional tools such as iotop are not available, estimate using ps and df.
Actual output screen
This is the result of checking per-disk I/O latency and utilization (%util saturation).
!iostat command output: disk I/O statistics
Live production server
Source (HTML): https://games.aidebatehub.com/programs/linux/troubleshooting/iostat.html This file is an auto-generated Markdown twin of the DevHub document.
AI Knowledge Hub
Visitor Comments