iostat
iostat is a performance monitoring tool that displays disk I/O statistics.
CLI mode:
iostat [ options ] [ <interval> [ <count> ] ]
Parameters:
Valid values of options:
- -C: specifies to display the CPU utilization.
- -d: specifies to display the disk usage.
- -k: specifies to display the statistics in KB.
- -m: specifies to display the statistics in MB.
- -N: specifies to display the statistics of Logical Volume Manager (LVM).
- -n: specifies to display the NFS usage.
- -p[disk name]: specifies to display the disk and partition information.
- -t: specifies to display the terminal and CPU information.
- -x: specifies to display detailed information.
interval: the output refresh interval.
count: the number of output times.
You can run iostat -x 1 3 to view disk input and output details. Sample code:
$iostat -x 1 3
avg-cpu: %user %nice %system %iowait %steal %idle
0.03 0.00 0.00 0.00 0.00 99.97
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 0.00 0.00 1.00 0.00 16.00 0.00 16.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdc 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdd 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sde 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdf 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdg 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdh 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdi 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdj 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdk 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdl 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
md127 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
md126 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Field description:
avg-cpu:
- %user: the percentage of CPU time for the execution of user-mode threads.
- %nice: the percentage of CPU time for the execution of user-mode threads with a Nice value.
- %system: the percentage of CPU time for the execution of core-mode threads.
- %iowait: the percentage of CPU time for I/O waiting.
- %steal: the percentage of unconscious wait time of the virtual CPU when the manager program maintains another virtual CPU.
- %idle: the percentage of CPU idle time.
Device: the disk name.
rrqm/s: the number of read operations merged per second.
wrqm/s: the number of write operations merged per second.
r/s: the number of I/O reads per second.
w/s: the number of I/O writes per second.
rsec/s: the number of sectors read per second.
wsec/s: the number of sectors written per second.
rkB/s: the number of kilobytes read per second.
wkB/s: the number of kilobytes written per second.
avgrq-sz: the average size of the I/O requests.
avgqu-sz: the average queue length of the I/O requests.
await: the average waiting time (in milliseconds) of I/O requests.
svctm: the average service time (in milliseconds) for I/O requests.
%util: the percentage of CPU time occupied by I/O requests.
Description
%util indicates the I/O utilization of the disk. A high value denotes an I/O utilization bottleneck. In addition, the wait time includes the average time spent by I/O requests in queue and the average time spent on servicing them. Therefore, if the await value is far greater than the svctm value, I/O requests have queued for a long time.