web-dev-qa-db-ja.com

iostat:awaitとsvctm

iostatのマンページで、次の2つの同様の列を見つけました。

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.

これらの列は同じものを表すためのものですか?私は時々彼らが同意するように見えますが、時にはそうではありません:

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

svctmが減価されているという明白な警告以外に、これら2つの列の違いは何ですか

16
dotancohen

Linuxのiostatでは、await列(平均待機)は、I/O要求が最初から最後まで計算した平均時間を示しています。

svctm列(サービス時間)は、リクエストのサービスに費やされた平均時間、つまりOSの「外部」で費やされた時間を表示する必要があります。デバイスがすでにビジー状態で、同時リクエストをこれ以上受け入れない場合、リクエストはキューで待機する時間を失った可能性があるため、前のリクエストと同じかそれよりも小さい必要があります。

他のほとんどすべてのUnix/Unixのような実装とは異なり、Linuxカーネルは実際のサービス時間を測定しないので、そのプラットフォームのiostatは既存の統計から取得しようとしていますが、これは外部では実行できないため失敗しますささいなユースケース。

詳細はこちら ブログとそれに続く興味深い議論 を参照してください。

13
jlliagre