iostat:等待与 svctm

dot*_*hen 17 linux monitoring io

iostat联机帮助页中,我发现了这两个类似的列:

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.
Run Code Online (Sandbox Code Playgroud)

这些列是否代表同一件事?我似乎有时他们同意,但有时不同意:

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
Run Code Online (Sandbox Code Playgroud)

除了明显的svctm折旧警告外,这两列有什么区别

jll*_*gre 15

在 linux 上iostatawait列(平均等待时间)显示了从开始到结束计算的 I/O 请求所花费的平均时间。

所述svctm柱(服务时间)应显示花费请求提供服务的平均时间,即所花费的时间“外”的OS。它应该等于或小于前一个,因为如果设备已经很忙并且不接受更多并发请求,则请求可能会失去在队列中等待的时间。

与大多数(如果不是全部)其他 Unix / 类 Unix 实现不同,Linux 内核不测量实际服务时间,因此iostat该平台试图从现有统计数据中推导出它,但失败了,因为这无法在琐碎的用例之外完成。

有关详细信息请参阅此博客和随后的有趣讨论

  • 谢谢。我现在明白了`await` = `svctm` + `however_long_in_queue`,正如精美的手册所述! (3认同)