Using iostat to gather CPU and IO Information

Overview

I was investigating a SQL script that was taking several hours to run. Granted there were a few million rows involved, I still felt the performance could stand improvement. I was advised to examine my system status with iostat1. This paper introduces the tool and briefly touches upon interpreting its information. Here is a description of the tool directly from the man page:

The iostat command is used for monitoring system input/output device
loading by observing the time the devices are active in relation to
their average transfer rates. The iostat command generates reports that
can be used to change system configuration to better balance the
input/output load between physical disks.

Example

Here is an example of running: iostat -x

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.03    0.00    0.14    0.14    0.00   98.68

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.51    44.66    2.32    9.24   317.02   431.29    64.77     0.32   27.60   1.25   1.44
sda1              0.51    44.66    2.32    9.24   317.01   431.28    64.77     0.32   27.60   1.25   1.44
sda2              0.00     0.00    0.00    0.00     0.00     0.00     2.00     0.00   24.00  24.00   0.00
sda5              0.00     0.00    0.00    0.00     0.00     0.00    28.53     0.00   39.52  26.48   0.00

Interpretations

Part of iostat’s results when run with -x are reported by device. There are a number of columns output data. I will mention a few, and the manpage has them all.


r/s

read requests per second per device

w/s

write requests per second per device

svctm

the average serice time (milliseconds) for I/O request per device.

%util

percent of CPU time during which I/O requests were issued to the device.

The values reported above for these for variables were not considered a bottleneck point because they are considered low.

Foot Notes

1 The debian package sysstat includes the tool iostat

My tags:
 
Popular tags:
 
Powered by MojoMojo