Iotop

来自linux中国网wiki
跳到导航 跳到搜索

iotop

NAME and DESCRIPTION

       iotop  watches I/O usage information output by the Linux kernel (requires 2.6.20 or later) and displays a
       table of current I/O usage by processes or threads on the system. At  least  the  CONFIG_TASK_DELAY_ACCT,
       CONFIG_TASK_IO_ACCOUNTING,  CONFIG_TASKSTATS  and  CONFIG_VM_EVENT_COUNTERS options need to be enabled in
       your Linux kernel build configuration.

通过输出结果,我们可以清楚地知晓是什么程序在读写磁盘,速度以及命令行,pid 等信息。

OPTIONS

 -o , --only   only show processes or threads actually doing I/O:只显示有io操作的进程
-b, --batch    non-interactive mode:批量显示,无交互,主要用作记录到文件。
-n NUM:显示NUM次,主要用于非交互式模式。
-d SEC:间隔SEC秒显示一次。
-p PID:监控的进程pid。
-u USER:监控的进程用户。

EXAMPLES

 用法举例  有一个机器半夜3 点 报警IO高 于是 
# m h  dom mon dow   command
*/5 2 * * * /usr/sbin/iotop -o   -b -n3  >> /root/iotop.txt
*/5 3 * * * /usr/sbin/iotop -o   -b  >> /root/iotop.txt
*/5 4 * * * /usr/sbin/iotop -o   -b  >> /root/iotop.txt


过程 一开始 想到的是 non-interactive 于是有了-b  再后来想到只要有R的 于是有了-o 但是放在web2 测试才发现iotop 进程好多 搞半天 终于明白了加上-n 3 完美  

# mon io 4 evan 

02 3 * * * /usr/sbin/iotop -o   -b    -n 3 >> /data/iotop.txt
03 3 * * * /usr/sbin/iotop -o   -b   -n 3 >> /data/iotop.txt

参考

http://man.linuxde.net/iotop http://www.361way.com/iotop/1653.html

Linux下的IO监控与分析

如何查看进程 IO 读写情况?

Linux的IO性能监控工具iostat详解


http://www.weicot.com/linux-top-iotop-%E5%B7%A5%E5%85%B7%E5%8F%82%E6%95%B0%E5%8F%8A%E8%BE%93%E5%87%BA%E8%AF%A6%E8%A7%A3/

http://blog.chinaunix.net/uid-434226-id-3297460.html

http://www.jb51.net/LINUXjishu/247796.html

http://blog.csdn.net/aibisoft/article/details/25633977