[Linux 運維 -- 存儲] /proc/diskstats詳解


[Linux 運維 -- 存儲] /proc/diskstats詳解

# cat /proc/diskstats
   1       0 ram0 0 0 0 0 0 0 0 0 0 0 0
   1       1 ram1 0 0 0 0 0 0 0 0 0 0 0
   1       2 ram2 0 0 0 0 0 0 0 0 0 0 0
   1       3 ram3 0 0 0 0 0 0 0 0 0 0 0
   1       4 ram4 0 0 0 0 0 0 0 0 0 0 0
   1       5 ram5 0 0 0 0 0 0 0 0 0 0 0
   1       6 ram6 0 0 0 0 0 0 0 0 0 0 0
   1       7 ram7 0 0 0 0 0 0 0 0 0 0 0
   1       8 ram8 0 0 0 0 0 0 0 0 0 0 0
   1       9 ram9 0 0 0 0 0 0 0 0 0 0 0
   1      10 ram10 0 0 0 0 0 0 0 0 0 0 0
   1      11 ram11 0 0 0 0 0 0 0 0 0 0 0
   1      12 ram12 0 0 0 0 0 0 0 0 0 0 0
   1      13 ram13 0 0 0 0 0 0 0 0 0 0 0
   1      14 ram14 0 0 0 0 0 0 0 0 0 0 0
   1      15 ram15 0 0 0 0 0 0 0 0 0 0 0
   7       0 loop0 0 0 0 0 0 0 0 0 0 0 0
   7       1 loop1 0 0 0 0 0 0 0 0 0 0 0
   7       2 loop2 0 0 0 0 0 0 0 0 0 0 0
   7       3 loop3 0 0 0 0 0 0 0 0 0 0 0
   7       4 loop4 0 0 0 0 0 0 0 0 0 0 0
   7       5 loop5 0 0 0 0 0 0 0 0 0 0 0
   7       6 loop6 0 0 0 0 0 0 0 0 0 0 0
   7       7 loop7 0 0 0 0 0 0 0 0 0 0 0
 202       0 xvda 88773 1108 2010114 551529 31249889 47896636 633188176 338606000 0 56198497 339137808
 202       1 xvda1 88624 1108 2008922 551388 31249889 47896636 633188176 338606000 0 56198357 339137671
 202      16 xvdb 329 484 2628 305 0 0 0 0 0 304 304
 202      17 xvdb1 302 484 2412 296 0 0 0 0 0 296 296

每一列的含義分別為:

  • 第一列為 設備號

(number of issued reads. This is the total number of reads completed successfully.)

  • 第二列為 次設備號

(number of reads merged)

  • 第三列為 設備名稱

(number of sectors read. This is the total number of sectors read successfully.)

  • 第四列為 成功完成讀的總次數

(number of milliseconds spent reading. This is the total number of milliseconds spent by all reads (as measured from __make_request() to end_that_request_last()).)

  • 第五列為 合並讀次數,為了效率可能會合並相鄰的讀和寫,從而兩次4K的讀在它最終被處理到磁盤上之前可能會變成一次8K的讀,才被計數(和排隊),因此只有一次I/O操作。

(number of writes merged Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done.)

  • 第六列為 讀扇區的次數

  • 第七列為 讀花的時間(ms),這是所有讀操作所花費的毫秒數(用__make_request()到end_that_request_last()測量)

  • 第八列到第十一列分別是寫

  • 第十二列為 I/O的當前進度,只有這個域應該是0,如果這個值為0,同時write_complete read_complete io_processing 一直不變可能就就是IO hang了。

number of I/Os currently in progress. The only field that should go to zero. Incremented as requests are given to appropriate request_queue_t and decremented as they finish.)

  • 第十三列為 輸入輸入花的時間(ms),花在I/O操作上的毫秒數,這個域會增長只要field 9不為0。

(number of milliseconds spent doing I/Os. This field is increased so long as field 9 is nonzero.)

  • 第十四列為 輸入/輸出操作花費的加權毫秒數,

(number of milliseconds spent doing I/Os. This field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating.)

可以參考:

  The /proc/diskstats file displays the I/O statistics
    of block devices. Each line contains the following 14
    fields:
     1 - major number
     2 - minor mumber
     3 - device name
     4 - reads completed successfully
     5 - reads merged
     6 - sectors read
     7 - time spent reading (ms)
     8 - writes completed
     9 - writes merged
    10 - sectors written
    11 - time spent writing (ms)
    12 - I/Os currently in progress
    13 - time spent doing I/Os (ms)
    14 - weighted time spent doing I/Os (ms)

/sys/block/device_name/stat的輸出和上面各個字段是一樣的。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM