Linux Command: iostat
Report CPU and I/O statistics
iostat reports CPU and I/O statistics for devices and partitions. It is the primary tool for monitoring disk I/O performance, identifying bottlenecks, and measuring throughput. iostat shows read/write speeds, I/O operations per second (IOPS), average queue sizes, and service times. This data is essential for diagnosing slow disk performance. iostat is part of the sysstat package and is commonly used alongside vmstat and sar for comprehensive system monitoring.
Syntax
iostat [OPTION]... [DEVICE] [INTERVAL]Key Options
-xโ Extended statistics-dโ Device statistics only-cโ CPU statistics only-hโ Human-readable-pโ Include partitionsNโ Update interval in seconds
Examples
Extended I/O stats
iostat -x 1Output: Device r/s w/s rkB/s wkB/s await %util
sda 10.5 25.3 420.0 1012.0 2.5 15.3
Device stats only
iostat -d 2Human-readable
iostat -dh 1Pro Tips
- %util >70% means device is busy. await >10ms on SSD = problem. r/s and w/s show IOPS.
- Install with: apt install sysstat or yum install sysstat.
- Like vmstat, the first report shows averages since boot. Subsequent reports show current values.
Learn more: Full iostat reference โ
Related Resources