举例说明:
watch -n 2(秒) -d top -b -n -p PID
例如监控mysql进程的资源咱用情况:
watch -n 2 -d top -b -n -p 11709
输出结果如下:
Every 2.0s: top -b -n 1 -p 11709 Sun Apr 22 11:08:46 2012
top - 11:08:47 up 9:28, 3 users, load average: 0.00, 0.00, 0.00
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 2051700k total, 1203080k used, 848620k free, 65780k buffers
Swap: 1048568k total, 0k used, 1048568k free, 695680k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
11709 root 20 0 103m 1348 1116 S 0.0 0.1 0:00.00 mysqld_safe
阅读(632) | 评论(0) | 转发(0) |