2018年1月3日 星期三

察看硬碟IOPS和目前狀況

察看硬碟IOPS和目前狀況







iostat -d -m -x -t 1 10

      1代表每1秒更新一次資訊。
      10代表顯示10次結果就停止動作。


iostat參數說明:
-c:只顯示CPU的狀態。
-d:只顯示儲存設備(如HDD)的狀態,不能與 -c 並用。
-m:以MB的單位來顯示。
-t:顯示日期出來
-x : 顯示詳細資訊


標籤說明:
rrqm/s: 每秒進行 merge 的讀運算元目.即 delta(rmerge)/s
wrqm/s: 每秒進行 merge 的寫運算元目.即 delta(wmerge)/s
The number of merged read and write requests queued per second. “Merged” means the operating system took multiple logical requests and grouped them into a single request to the actual device.

r/s: 每秒完成的讀 I/O 設備次數.即 delta(rio)/s
w/s: 每秒完成的寫 I/O 設備次數.即 delta(wio)/s
The number of read and write requests sent to the device per second.

rsec/s: 每秒讀磁區數.即 delta(rsect)/s
wsec/s: 每秒寫磁區數.即 delta(wsect)/s
The number of sectors read and written per second. Some systems also output rkB/s and wkB/s, the number of kilobytes read and written per second. We omit those for brevity.

rkB/s: 每秒讀K位元組數.是 rsect/s 的一半,因為每磁區大小為512位元組.(需要計算)
wkB/s: 每秒寫K位元組數.是 wsect/s 的一半.(需要計算)

avgrq-sz:平均每次設備I/O操作的資料大小 (磁區).delta(rsect+wsect)/delta(rio+wio)
The request size in sectors.
avgqu-sz:平均I/O佇列長度.即 delta(aveq)/s/1000 (因為aveq的單位為毫秒).
The number of requests waiting in the device’s queue.

await: 平均每次設備I/O操作的等待時間 (毫秒).即 delta(ruse+wuse)/delta(rio+wio)
The number of milliseconds required to respond to requests, including queue time and service time. Unfortunately, iostat doesn’t show separate service time statistics for read and write requests, which are so different that they really shouldn’t be averaged together. However, you can probably chalk up high I/O waits to reads, because writes can often be buffered but reads usually have to be served directly from the spindles.

svctm: 平均每次設備I/O操作的服務時間 (毫秒).即 delta(use)/delta(rio+wio)
The number of milliseconds spent servicing requests, from beginning to end, including queue time and the time the device actually takes to fulfill the request.

%util: 一秒中有百分之多少的時間用於 I/O 操作,或者說一秒中有多少時間 I/O 佇列是非空的,即 delta(use)/s/1000 (因為use的單位為毫秒)
The percentage of CPU time during which requests were issued. This really shows the device utilization, as the name implies, because when the value approaches 100%, the device is saturated.

如果 %util 接近 100%,說明產生的I/O請求太多,I/O系統已經滿負荷,該磁片可能存在瓶頸
idle小於70% IO壓力就較大了,一般讀取速度有較多的wait。
同時可以結合vmstat 查看查看b參數(等待資源的進程數)和wa參數(IO等待所佔用的CPU時間的百分比,高過30%時IO壓力高)。

沒有留言:

張貼留言