Databases Reference
In-Depth Information
How to Read iostat Output
Now let's move on to
iostat
.
13
By default, it shows some of the same CPU usage infor-
mation as
vmstat
. We're usually interested in just the I/O statistics, though, so we use
the following command to show only extended device statistics:
$
iostat -dx 5
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 1.6 2.8 2.5 1.8 138.8 36.9 40.7 0.1 23.2 6.0 2.6
As with
vmstat
, the first report shows averages since the server was booted (we generally
omit it to save space), and the subsequent reports show incremental averages. There's
one line per device.
There are various options that show or hide columns. The official documentation is a
bit confusing, and we had to dig into the source code to figure out what was really being
shown. The columns we've shown are the following:
rrqm/s
and
wrqm/s
The number of merged read and write requests queued per second. “Merged”
means the operating system took multiple logical requests from the queue and
grouped them into a single request to the actual device.
r/s
and
w/s
The number of read and write requests sent to the device per second.
rsec/s
and
wsec/s
The number of sectors read and written per second. Some systems also output
rkB/
s
and
wkB/s
, the number of kilobytes read and written per second. We omit those
for brevity.
avgrq-sz
The request size in sectors.
avgqu-sz
The number of requests waiting in the device's queue.
await
The number of milliseconds spent in the disk queue. Unfortunately,
iostat
doesn't
show separate statistics for read and write requests, which are so different that they
really shouldn't be averaged together. This is often very important when you're
trying to diagnose a performance issue.
svctm
The number of milliseconds spent servicing requests, excluding queue time.
13. The
iostat
examples we show in this topic have been slightly reformatted for printing: we've reduced the
number of decimal places in the values to avoid line wrapping. Also, we're showing examples on GNU/
Linux; other operating systems will give completely different output.