系統技術非業餘研究 » IO模式調查利器blkiomon介紹
阿新 • • 發佈:2018-12-31
blkiomon 是blktrace工具包帶的一個方便使用者瞭解IO情況的工具, 由於blktrace太專業,需要了解的IO協議棧的東西太多,blkiomon給大多數的使用者提供了一種易於使用的方式.
blktrace的使用參考這裡: http://blog.yufeng.info/archives/tag/blktrace
他可以告訴你IO的大小,完成花費時間,吞吐量, 還可以統計出這次關鍵引數的分佈.
具體見man blkiomon
blkiomon is a block device I/O monitor. It periodically generates per-device request size and request latency statistics from blktrace data. It
provides histograms as well as data that can be used to calculate min, max, average and variance. For this purpose, it consumes D and C traces
read from stdin.
我們來演示下:
$ sudo yum -y install blktrace $ pwd /u01 $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdb1 5568626692 14335120 5266858860 1% /u01 ... $ sudo blktrace /dev/sdb1 -a issue -a complete -w 3600 -o - | blkiomon -I 10 -h - #在另外一個終端執行: $ sudo dd if=/dev/zero of=test.dat bs=4096 count=111112 111112+0 records in 111112+0 records out 455114752 bytes (455 MB) copied, 0.709956 seconds, 641 MB/s #我們可以看到blkiomon說: time: Wed Nov 9 21:45:53 2011 device: 8,17 sizes read (bytes): num 0, min -1, max 0, sum 0, squ 0, avg nan, var nan sizes write (bytes): num 1507, min 4096, max 327680, sum 455626752, squ 146959973220352, avg 302340.2, var 6108605540.9 d2c read (usec): num 0, min -1, max 0, sum 0, squ 0, avg nan, var nan d2c write (usec): num 1507, min 180, max 263554, sum 139205481, squ 17063321146863, avg 92372.6, var 2790014230.4 throughput read (bytes/msec): num 0, min -1, max 0, sum 0, squ 0, avg nan, var nan throughput write (bytes/msec): num 1507, min 15, max 368593, sum 7687253, squ 314837228769, avg 5101.0, var 182896029.6 sizes histogram (bytes): 0: 0 1024: 0 2048: 0 4096: 80 8192: 0 16384: 1 32768: 5 65536: 6 131072: 2 262144: 110 524288: 1303 1048576: 0 2097152: 0 4194304: 0 8388608: 0 > 8388608: 0 d2c histogram (usec): 0: 0 8: 0 16: 0 32: 0 64: 0 128: 0 256: 1 512: 1 1024: 1 2048: 1 4096: 3 8192: 8 16384: 3 32768: 95 65536: 395 131072: 718 262144: 280 524288: 1 1048576: 0 2097152: 0 4194304: 0 8388608: 0 16777216: 0 33554432: 0 >33554432: 0 bidirectional requests: 0
從輸出可以瞭解的很清楚我們的io模式,也很方便使用.
祝玩得開心!
Post Footer automatically generated by wp-posturl plugin for wordpress.