Tech Support Notes

iostat

Using the iostat tool, you can monitor the I/O device loading in real time. Different options enable you to drill down even deeper to gather the necessary data.

To simulate some disk activity I will start writing to some files in screen and then measure the disk activity with iostat. Started in screen: for (( i=1;i<50;i++ )); do touch "file$i"; shred -n0 -z -s50M "file$i"; done

Let's check iostat:

[callisto] (~/testing) >>> iostat 2 -x /dev/xvda
Linux 2.6.32-431.1.2.0.1.el6.x86_64 (callisto.example.ccom)         02/25/2014      _x86_64_        (3 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.25    0.02    0.15    0.02    0.00   99.56

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
xvda              0.00     2.35    0.30    2.01    10.89    34.92    19.77     0.01    4.70   0.35   0.08

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.17    0.00    9.46   22.47    0.17   67.74

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
xvda              0.00 28211.50    0.50 2923.50     4.00 244052.00    83.47   105.69   35.67   0.26  76.65

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.51    0.00    8.09   25.46    0.17   65.77

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
xvda              0.00 17732.00    0.00 1888.50     0.00 156272.00    82.75   107.18   56.67   0.44  83.10

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.17    0.00    9.18   22.62    0.00   68.03

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
xvda              0.00 23612.00    2.00 3000.50    16.00 225152.00    74.99    83.88   28.45   0.25  76.10

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    5.48   24.14    0.17   70.21

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
xvda              0.00 11594.50    1.50 2976.50    12.00 144080.00    48.39    35.82   12.03   0.28  84.70

Examples for Iostat, vmstat and, mpstat