Linux IO iostat

  • iostat -x -k -d 10 360

 -d     Display the device utilization report.
 -k     Display statistics in megabytes per second
 -x     Display extended statistics.
 10        10 seconds interval
 360    360 times

e.g.

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  163.50    2.50  1282.00    30.00    15.81     0.88    5.33    5.40    0.20   5.03  83.50
dm-0              0.00     0.00  163.00    2.50  1280.00    30.00    15.83     0.88    5.33    5.40    0.20   5.04  83.35
dm-1              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

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               1.49   134.83  136.82  244.28  1701.49  3174.13    25.59     4.82   12.47    6.99   15.53   2.22  84.48
dm-0              0.00     0.00  138.81  379.10  1707.46  3174.13    18.85     7.41   14.17    6.99   16.80   1.63  84.48
dm-1              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

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               1.50     0.00  126.00    7.50  4428.00    78.00    67.51     1.37   10.75   11.37    0.40   6.20  82.75
dm-0              0.00     0.00  140.00    7.50  4424.00    78.00    61.04     1.39    9.85   10.36    0.40   5.61  82.70
dm-1              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

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               2.00     0.00  130.50    8.00   990.00   122.00    16.06     1.03    7.45    7.89    0.31   6.06  83.90
dm-0              0.00     0.00  133.00    8.00   988.00   122.00    15.74     1.04    7.42    7.85    0.25   5.95  83.90
dm-1              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

 rrqm/s
       The number of read requests merged per second that were queued to the device.
wrqm/s
       The number of write requests merged per second that were queued to the device.
r/s
       The number (after merges) of read requests completed per second for the device.
w/s
       The number (after merges) of write requests completed per second for the device.
rsec/s (rkB/s, rMB/s)
       The number of sectors (kilobytes, megabytes) read from the device per second.
wsec/s (wkB/s, wMB/s)
       The number of sectors (kilobytes, megabytes) written to the device per second.
avgrq-sz
       The average size (in sectors) of the requests that were issued to the device.
avgqu-sz
       The average queue length of the requests that were issued to the device.
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.
r_await
       The average time (in milliseconds) for read requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
w_await
       The average time (in milliseconds) for write 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.
%util
       Percentage of elapsed time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.

1. 如果 %util 接近 100%,说明产生的I/O请求太多,I/O系统已经满负荷,该磁盘可能存在瓶颈。
2. avgqu-sz 表示磁盘IO队列长度,即IO等待个数。
3. await 表示每次IO请求等待时间,包括等待时间和处理时间


  • iostat 10 360

 10        10 seconds interval
 360    360 times

 

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          84.71    0.00    5.98    0.45    0.00    8.85

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda             276.10      4707.20        23.60      47072        236
dm-0            273.00      4684.40        23.60      46844        236
dm-1              5.70        22.80         0.00        228          0

 
1. iowait% 表示CPU等待IO时间占整个CPU周期的百分比,如果iowait值超过50%,或者明显大于%system、%user以及%idle,表示IO可能存在问题。

posted @ 2021-12-01 15:13  tang88seng  阅读(38)  评论(0编辑  收藏  举报