开启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