8

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.

2 Answers 2

13

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
2

You can use sar command.

root@virt01:~# sar 1 1
Linux 3.19.0-42-generic (virt01.ubuntu.com)     13/02/16        _x86_64_        (1 CPU)

12:19:55        CPU     %user     %nice   %system   %iowait    %steal     %idle
12:19:56        all      0.00      0.00      0.00      0.00      0.00    100.00
Average:        all      0.00      0.00      0.00      0.00      0.00    100.00
root@virt01:~#

In Ubuntu installation process

sudo apt-get install sysstat
 sed -i 's/ENABLED="false"/ENABLED="true"/' /etc/default/sysstat
 /etc/init.d/sysstat start
2
  • 2
    How do you show disk latencies using sar?
    – Mat
    Feb 13, 2016 at 7:26
  • 1
    You need to specify the -d option to sar Apr 1, 2017 at 21:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .