How to read the iostat command
I believe that most performance issues related to slowness occur because of slow disks or poor application tuning. Memory is a big factor when it comes to OS-level caching and buffering but there’s nothing like a fast SCSI array or even a few WD Raptors in RAID-1.
The Linux utility "iostat" allows you to see a complete overview of disk utilization. The iostat utility does this by looking at the time the device is active in relation to the devices average transfer rate.
Using the iostat utility with the -x flag (-x is for extended statistics) will yield results that look like this:
If the iostat command is not available on your system perform one of the following commands to install the sysstat package.
CentOS/RHEL - # yum -y install sysstat
Ubuntu/Debian - # apt-get install sysstat
Pay special attention to the "%util" column of the results. In the example above the percentage of CPU time for I/O requests for /dev/sdb is quite high. This device is actually a large RAID-6 array and has not yet reached its 100% utilization mark. The closer the device or array is to 100% the closer you are to total saturation of that device.
If your utilization numbers are higher than expected take the following into consideration:
- Tune the application (This is where you can gain the cheapest and most performance)
- Obtain faster disks (10K+ SATA/SAS/SCSI)
- Use a larger and more efficient RAID array for your application (RAID 0 for video editing, RAID-10 for databases, RAID-5 for file storage and general access and RAID-6 on newer controllers for increased redundancy)