iostat to gather CPU and IO Information
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:
Here is an example of running:
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
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.
- read requests per second per device
- write requests per second per device
- the average serice time (milliseconds) for I/O request per device.
- 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.
1 The debian package
sysstat includes the tool
Showing changes from previous revision.