Java Reference
In-Depth Information
% iostat -xm 5
avg-cpu: %user %nice %system %iowait %steal %idle
23.45 0.00 37.89 0.10 0.00 38.56
Device: rrqm/s wrqm/s r/s w/s rMB/s
sda 0.00 11.60 0.60 24.20 0.02
wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
0.14 13.35 0.15 6.06 5.33 6.08 0.42 1.04
The application here is writing data to disk sda . At first glance, the disk statistics look good.
The w_await —the time to service each I/O write—is fairly low (6.08 ms), and the disk is
only 1.04% utilized. (The acceptable values for that depend on the physical disk, but the
5200 RPM disk in my desktop system behaves well when the service time is under 15 ms.)
But there is a clue here that something is wrong: the system is spending 37.89% of its time in
the kernel. If the system is doing other I/O (in other programs), that's one thing; if all that
system time is from the application being tested, then something inefficient is happening.
The fact that the system is doing 24.2 writes per second is another clue here: that is a lot
when writing only 0.14 MB per second (MBps). I/O has become a bottleneck, and the next
step would be to look into how the application is performing its writes.
The other side of the coin comes if the disk cannot keep up with the I/O requests:
% iostat -xm 5
avg-cpu: %user %nice %system %iowait %steal %idle
35.05 0.00 7.85 47.89 0.00 9.20
Device: rrqm/s wrqm/s r/s w/s rMB/s
sda 0.00 0.20 1.00 163.40 0.00
wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
81.09 1010.19 142.74 866.47 97.60 871.17 6.08 100.00
The nice thing about Linux is that it tells us immediately that the disk is 100% utilized; it
also tells us that processes are spending 47.89% of their time in iowait (that is, waiting for
the disk).
Even on other systems where only raw data is available, that data will tell us something is
amiss: the time to complete the I/O ( w_await ) is 871 ms, the queue size is quite large, and
the disk is writing 81 MB of data per second. This all points to disk I/O as a problem, and
Search WWH ::




Custom Search