Hi,
Need some clarifications on my understanding of iostat command.
Pasting the first line of output from this command .
$iostat
Linux 2.6.32-21-generic (desktop) Monday 10 January 2011 _i686_ (2
CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.09 0.03 0.74 0.07
0.00 99.08
My confusion is with the %iowait column. The man page says : iostat
"show the percentage of time that the CPU or CPUs were idle during
which the system had an outstanding disk I/O request ".
So , what I understood is that when the CPU is mostly idle and have
free cycles, and there is an IO request , the CPU can immediately
handle it since it has free cycles. Now if the CPU is 100% busy and
has no free cycles to handle an IO request , and there is a IO request
during that time , %iowait value is expected to increase based on my
understanding as the the request is waiting because CPU is busy and
has no free cycles left.
So , if there is an increase in IO wait time , we need to check the
CPU and memory utilization . There might me a possibility of bad
blocks in the disk also .
To simulate this , I tried the following .
I executed dd if=/dev/zero of=/home/test till the disk is saturated.
disk saturation I identified by running the iostat command on another
terminal and looking at the %util column after every 5 secs. %iowait
was mostly fluctuating within 35.00 when the disk was 100% saturated.
After waiting for around 3 minutes , I fired another IO intensive
command using dd . The disk was already 100% busy as per the %util
column. Now since the disk is fully saturated and has no free cycles
for the next dd command , I can see the %iowait went to around 70.00
and was fluctuating between and 50 and 70.
I terminated the second dd command and can see value of %iostat coming
down .
Is my understanding clear . Please clarify
Thanks in Advance