Chinaunix

标题: 请教,怎么查服务器cpu100%的原因? [打印本页]

作者: zhsp1029    时间: 2010-03-27 21:37
标题: 请教,怎么查服务器cpu100%的原因?
发现cpu不定时地大约1~2 秒的时间飙到100%,怎么查是哪个进程占用的?并且能不能查到这个进程在做些什么操作?比如做了哪些系统调用?
作者: 可爱的偏执狂    时间: 2010-03-27 23:35
先用top查看是哪些进程的cpu占用率不正常
然后用lsof查看这个进程打开了哪些文件,用netstat查看这个进程有哪些网络连接

通过流量监控工具看流量ntop
看系统资源,MEM,CPU,DISK I/O :vmstat,free.




top - display Linux tasks
ps - report a snapshot of the current processes.
lsof - list open files
netstat  - Print network connections, routing tables, interface statistics, masquerade
       connections, and multicast memberships
作者: bluewaterray    时间: 2010-03-28 12:24
先用top查看是哪些进程的cpu占用率不正常
然后用lsof查看这个进程打开了哪些文件,用netstat查看这个进程有 ...
可爱的偏执狂 发表于 2010-03-27 23:35



    相当全了,UP
作者: vbirding    时间: 2010-03-28 21:35
学习了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2