Linux – where can I find the disk latency using iostat ( await, svctm, %util )

diskiostatlinuxrhel

I'm using Redhat Linux 6.5 and would like to see the disk latencies for the used disks.

Using iostat I get the columns await and svctm ( including %util ).
But according to the man page of iostat the columns svctm are obsolete and should not be used any more .

So what can I use to see the disk latencies for my disks.

Best Answer

You can use iostat -x and check for the await column - per device it shows the total time spent waiting plus the actual handling of the request by the disk. The units here are milli-seconds.

$ iostat -yzx 5
Linux 2.6.32-642.13.1.el6.x86_64 (vagrant1)     04/01/2017      _x86_64_        (1 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.20    0.00    0.00   99.80

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.20    0.00    2.20     0.00    19.24     8.73     0.00    2.00    0.00    2.00   0.45   0.10
dm-0              0.00     0.00    0.00    2.40     0.00    19.24     8.00     0.01    2.17    0.00    2.17   0.42   0.10

You can also use sar -d. Again the await column shows avg request latency in ms.

$ sar -d
04:50:01 PM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
05:00:01 PM    dev8-0      0.12      0.00      0.92      7.67      0.00      1.21      0.90      0.01
05:00:01 PM  dev253-0      0.12      0.00      0.92      8.00      0.00      1.45      0.94      0.01
05:00:01 PM  dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
05:10:01 PM    dev8-0      0.14      0.00      1.07      7.90      0.00      1.05      0.80      0.01
05:10:01 PM  dev253-0      0.13      0.00      1.07      8.00      0.00      1.18      0.81      0.01
05:10:01 PM  dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
05:20:01 PM    dev8-0      0.11      0.00      0.79      7.26      0.00      1.52      1.05      0.01
05:20:01 PM  dev253-0      0.10      0.00      0.79      8.00      0.00      2.19      1.15      0.01
05:20:01 PM  dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
05:30:01 PM    dev8-0      0.12      0.00      0.97      7.89      0.00      1.22      0.93      0.01
05:30:01 PM  dev253-0      0.12      0.00      0.97      8.00      0.00      1.42      0.95      0.01
05:30:01 PM  dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
05:40:01 PM    dev8-0      0.12      0.00      0.84      7.20      0.00      0.96      0.77      0.01
05:40:01 PM  dev253-0      0.11      0.00      0.84      8.00      0.00      1.19      0.86      0.01
05:40:01 PM  dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
05:50:01 PM    dev8-0      0.11      0.00      0.84      7.75      0.00      1.31      0.94      0.01
05:50:01 PM  dev253-0      0.11      0.00      0.84      8.00      0.00      2.03      0.97      0.01
05:50:01 PM  dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Related Question