iostat syntax for disk utilization report
iostat -d -x interval count
- -d : Display the device utilization report (d == disk)
- -x : Display extended statistics including disk utilization
- interval : It is time period in seconds between two samples . iostat 2 will give data at each 2 seconds interval.
- count : It is the number of times the data is needed . iostat 2 5 will give data at 2 seconds interval 5 times
命令
iostat -d -x 5 3
- rrqm/s : The number of read requests merged per second that were queued to the hard disk
- wrqm/s : The number of write requests merged per second that were queued to the hard disk
- r/s : The number of read requests per second
- w/s : The number of write requests per second
- rsec/s : The number of sectors read from the hard disk per second
- wsec/s : The number of sectors written to the hard disk per second
- avgrq-sz : The average size (in sectors) of the requests that were issued to the device.
- avgqu-sz : The average queue length of the requests that were issued to the device
- await : The average time (in milliseconds) for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
- svctm : The average service time (in milliseconds) for I/O requests that were issued to the device
- %util : Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.
How do I interpret the output result for optimization?
First you need to note down following values from the iostat output:
- The average service time (svctm)
- Percentage of CPU time during which I/O requests were issued (%util)
- See if a hard disk reports consistently high reads/writes (r/s and w/s)
If any one of these are high, you need to take one of the following action:
- Get high speed disk and controller for file system (for example move from SATA I to SAS 15k disk)
- Tune software or application or kernel or file system for better disk utilization
- Use RAID array to spread the file system
For example, from about iostat report it appears that /dev/sdb under load. Hope this information will help you diagnose and optimize disk related issues.
http://www.cyberciti.biz/tips/linux-disk-performance-monitoring-howto.htm