linux iotop

iotop
专门显示硬盘IO的命令,界面风格类似top命令。这个命令只有在kernel v2.6.20及以后的版本中才有。
介绍:
iotop is a Python program with a top like UI used to show of behalf of which process is the I/O going on. It requires Python >= 2.5 (or Python >= 2.4 with the ctypes module) and a Linux kernel >= 2.6.20 with the TASK_DELAY_ACCT and TASK_IO_ACCOUNTING options enabled.
如果python小于2.6,需要安装ctypes模块。
yum install python-ctypes
就行了。

1、直接yum安装,rh6的光盘里有包。
yum install iotop

2、命令参数介绍
# ./iotop.py --help
usage: ./iotop.py [OPTIONS]

DISK READ and DISK WRITE are the block I/O bandwidth used during the sampling
period. SWAPIN and IO are the percentages of time the thread spent respectively
while swapping in and waiting on I/O more generally. PRIO is the I/O priority at
which the thread is running (set using the ionice command).

Controls: left and right arrows to change the sorting column, r to invert the
sorting order, o to toggle the --only option, p to toggle the --processes
option, a to toggle the --accumulated option, q to quit, any other key to force
a refresh.

options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -o, --only            only show processes or threads actually doing I/O
  -b, --batch           non-interactive mode
  -n NUM, --iter=NUM    number of iterations before ending [infinite]
  -d SEC, --delay=SEC   delay between iterations [1 second]
  -p PID, --pid=PID     processes/threads to monitor [all]
  -u USER, --user=USER  users to monitor [all]
  -P, --processes       only show processes, not all threads
  -a, --accumulated     show accumulated I/O instead of bandwidth
  -k, --kilobytes       use kilobytes instead of a human friendly unit
  -t, --time            add a timestamp on each line (implies --batch)
  -q, --quiet           suppress some lines of header (implies --batch)

3、使用截图



[root@localhost tmp]# iotop -o 


iotop命令的键盘快捷键:
1、左右箭头改变排序方式,默认是按IO排序
2、r键是反向排序
3、o键是只显示有IO输出的进程
4、同样q是退出

异常处理:
在Centos5.5下执行./iotop.py
出现
CONFIG_TASK_DELAY_ACCT not enabled in kernel, cannot determine SWAPIN and IO %
那么需要重新编译内核
Centos6.2下正常

转载请注明文章转自:良玉的博客 [ http://blog.uouo123.com ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

向良玉

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值