Linux下查看进程的I/O占用情况

又一台服务器出现疑似I/O瓶颈:CPU占用0,系0负载却到了4,而且进程基本停滞了。。

iotop什么挺麻烦的,推荐一下iopp:

https://github.com/markwkm/iopp/

直接下载那个iopp.c编译就好了:

gcc ./iopp.c -o ./iopp

看一下用法:

usage: iopp -h|--help
usage: iopp [-ci] [-k|-m] [delay [count]]
 -c, --command display full command line
 -h, --help display help
 -i, --idle hides idle processes
 -k, --kilobytes display data in kilobytes
 -m, --megabytes display data in megabytes
 -u, --human-readable display data in kilo-, mega-, or giga-bytes

我们一般用-i -u就可以了,这样是列出进程,并隐藏I/O空闲的进程:

./iopp -i -u 1
pid    rchar    wchar    syscr    syscw      rkb      wkb     cwkb command
 4912        2        1        0        0        0        0        0 dbus-daemon
 5713        0        1        0        0        0        0        0 hald
 5717       17        0        0        0        0        0        0 hald-runner
 5932        0        2        0        0        0        0        0 NetworkManager
22101       94       28        0        0        0        0        0 Xorg
22238        4        4        0        0        0        0        0 pulseaudio
22684       29       55        1        0        0        0        0 firefox
26860        0       43        0        0        0        0        0 gnome-terminal

Leave a Reply

Your email address will not be published. Required fields are marked *