iostat: await vs. svctm

56,507

On linux iostat, the await column (average wait) is showing the average time spent by an I/O request computed from its very beginning toward its end.

The svctm column (service time) should display the average time spent servicing the request, i.e. the time spent "outside" the OS. It should be equal or smaller than the previous one as the request might have lost time waiting in a queue if the device is already busy and doesn't accept more concurrent requests.

Unlike most if not all other Unix / Unix like implementations, the Linux kernel doesn't measure the actual service time so iostat on that platform is trying to derive it from existing statistics but fails as this just cannot be done outside trivial use cases.

See this blog and the interesting discussions that follows for details.

Share:
56,507

Related videos on Youtube

dotancohen
Author by

dotancohen

Updated on September 18, 2022

Comments

  • dotancohen
    dotancohen over 1 year

    In the iostat manpage I have found these two similar columns:

    await
        The average time (in milliseconds) for I/O requests issued to the device to be  served.  This
        includes the time spent by the requests in queue and the time spent servicing them.
    
    svctm
        The  average  service time (in milliseconds) for I/O requests that were issued to the device.
        Warning! Do not trust this field any more.  This field will be removed in  a  future  sysstat
        version.
    

    Are these columns meant to represent the same thing? I seem that sometimes they agree, but sometimes not:

    avg-cpu:  %user   %nice %system %iowait  %steal   %idle
               4.44    0.02    1.00    0.36    0.00   94.19
    
    Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
    sda               0.07     0.96    0.28    1.28     8.98    47.45    72.13     0.02   11.36   11.49   11.34   5.71   0.89
    
    avg-cpu:  %user   %nice %system %iowait  %steal   %idle
               8.00    0.00    2.50    2.50    0.00   87.00
    
    Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
    sda               0.00     9.00    2.00    6.00    12.00    68.00    20.00     0.05    6.00    2.00    7.33   6.00   4.80
    
    avg-cpu:  %user   %nice %system %iowait  %steal   %idle
               4.57    0.00    0.51    0.00    0.00   94.92
    
    Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
    sda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
    
    avg-cpu:  %user   %nice %system %iowait  %steal   %idle
              13.93    0.00    1.99    1.49    0.00   82.59
    
    Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
    sda               0.00    29.00    0.00    4.00     0.00   132.00    66.00     0.03    7.00    0.00    7.00   7.00   2.80
    

    Other than the obvious warning that svctm is depreciated, what is the difference between these two columns?

  • dotancohen
    dotancohen over 10 years
    Thanks. I now understand that await = svctm + however_long_in_queue, just as the fine manual states!