開啟IO監控:
sysctl vm.block_dump=1
#或
echo 1 >/proc/sys/vm/block_dump
開啟後內核會將IO讀寫dump到日記,用dmesg查看:
dmesg
進程讀寫block到磁盤dm-0:
mysqld(7822): READ block 78196624 on dm-0
kjournald(529): WRITE block 211136 on dm-0
bash(8336): dirtied inode 7391146 (dmesg) on dm-0
統計當前占用IO最高的10個進程:
dmesg |awk -F: ‘{print $1}’|sort|uniq -c|sort -rn|head -n 10