iotop(单独iotop不够)+lsof(查找进程使用的文件)+fuser(查找使用文件的进程)。配合数据库的动态性能视图。
10. 通过某个进程号显示该进行打开的文件
lsof -p PID或lsof | grep PID
[root@hs-10-20-30-128 ~]# lsof | grep 7414 dd 7414 root cwd DIR 253,0 4096 117441024 /root dd 7414 root rtd DIR 253,0 4096 512 / dd 7414 root txt REG 253,0 74952 201385083 /usr/bin/dd dd 7414 root mem REG 253,0 106176928 83887307 /usr/lib/locale/locale-archive dd 7414 root mem REG 253,0 2156344 83887314 /usr/lib64/libc-2.17.so dd 7414 root mem REG 253,0 163312 83887306 /usr/lib64/ld-2.17.so dd 7414 root 0r CHR 1,5 0t0 2054 /dev/zero dd 7414 root 1w REG 253,0 6635716608 117600806 /root/balabal.baba dd 7414 root 2u CHR 136,1 0t0 4 /dev/pts/1
man lsof可以查看每一列的含义,比如文件类型的TYPE中``REG'' for a regular file。``DIR'' for a directory。FD中mem memory-mapped file;·
·