The iostat command is used to monitor system input/output device loading by observing the time the device are active in relation to their average transfer rate.
For disk statistics
# iostat -m 2 10 -x /dev/sda1 avg-cpu: %user %nice %system %iowait %steal %idle 0.31 0.00 0.50 0.19 0.00 99.00 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util sda1 0.00 30.00 0.00 14.00 0.00 0.17 25.14 0.85 60.71 5.50 7.70
where
“-m” = Display statistics in megabytes per second
“2 10” = 2 seconds for 10 times
-x = Display extended statistics.
AVG-CPU Statistics
- “%user” = % of CPU utilisation that occurred while executing at the user level (application)
- “%nice” = % of CPU utilisation that occurred while executing at the user level with nice priority
- “%system” = % of CPU utilisation that occurred while executing at the system level (kernel)
- “%iowait” = % of time CPU were idle during which the system had an outstanding disk I/O request
- “%steal” = % of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
- “%idle” = % of time that the CPU or CPUS were idle and the system does not have an outstanding disk I/O request
DEVICE Statistics
- “rrqm/s” = The number of read requests merged per second that were queued to the device.
- “wrqm/s” = The number of write requests merged per second that were queued to the device
- “r/s” = The number of read requests that were issued to the device per second.
- “w/s” = The number of write requests that was issued to the device per second.
- “rMB/s” = The number of megabytes read from the device per second.
- “wMB/s” = The number of megabytes written to the device 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.
- “svctm” = This field will be depreciated
- “util” = Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device).
Other usage of IOSTAT
1. Total Device Utilisation in MB
# iostat -d -m
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn sda 53.72 0.01 0.24 330249 8097912 sda1 53.66 0.01 0.24 307361 7997449 sda2 0.06 0.00 0.00 22046 100253 sda3 0.01 0.00 0.00 841 208 hda 0.00 0.00 0.00 1200 0
- tps = transfer per second. A transfer is an I/O request to the device
- MB_read = The total number of megabytes read
- MB_wrtn = The total number of megabytes written
- MB_read/s = Indicate the amount of data read from the device expressed in megabytes per second.
- MB_wrtn/s = Indicate the amount of data written to the device expressed in megabytes per second.
# iostat -n -m
..... ..... Device: rMB_nor/s wMB_nor/s rMB_dir/s wMB_dir/s rMB_svr/s wMB_svr/s ops/s rops/s wops/s NFS_Server:/vol/vol1 0.26 0.16 0.00 0.00 0.17 0.16 14.82 2.96 3.49
- ops/s = Indicate the number of operations that were issued to the mount point per second
- rops/s = Indicate the number of read operations that was issued to the mount point per second
- wops/s = Indicate the number of write operations that were issued to the mount point per second