≡ Menu

How to Check Disk Utilization on Linux with IOSTAT

linuxYou can use iostat command to check your disk utilization and monitoring sistem I/O device loading by observing the time the physical disks are active in relation to their average transfer rates.

Step 1: Install Sysstat Package

CentOS:

Debian/Ubuntu:

step 2 : iostat command for disk utilization report

iostat -d -x interval count

Description:

  • -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

e.g: To display 3 reports of extended statistics at 5 second intervals for disk

output:

Decription the output above:

  • 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

source: http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html

{ 0 comments… add one }

Leave a Comment