安装:yum install iotop -y
执行命令:iotop
[root@shvpuppet01 ~]# iotop No module named iotop.ui To run an uninstalled copy of iotop, launch iotop.py in the top directory
上面报错解决方法:
sed -i 's#/usr/bin/python#/usr/bin/python2.6#' `which iotop`
正常用时的输出:
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND 1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init 2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd] 3 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0] 4 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0] 5 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0] 6 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0] 7 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
常用参数:
-n:显示输出次数 -o:只显示有io输出的进程 -b:阻止动态显示
最常用使用的组合:
iotop -bon2
io异常时的输出:
[root@shvpuppet01 ~]# iotop -bon2 Total DISK READ: 0.00 B/s | Total DISK WRITE: 75.73 M/s TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND 20340 be/4 root 0.00 B/s 83.85 M/s 0.00 % 38.97 % dd if=/dev/zero of=./test.log bs=4M count=1024 1474 be/4 root 0.00 B/s 259.78 K/s 0.00 % 0.00 % [flush-8:0] 453 be/3 root 0.00 B/s 5.41 G/s 0.00 % 0.00 % [jbd2/sda3-8]
可以很直观的看到是dd进程占用大量的磁盘io~