做了一个服务器程序,客户端向服务器请后, cpu利用100%,然后就下不来(后面就没有向服务器发送请求了),如何来诊断,是那什么操作占用cpu.
top - 15:10:42 up 4:32, 2 users, load average: 8.45, 8.55, 8.64
Tasks: 124 total, 2 running, 122 sleeping, 0 stopped, 0 zombie
Cpu0 : 26.9%us, 73.1%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 30.2%us, 69.8%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 25.9%us, 74.1%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 24.7%us, 75.3%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 4089744k total, 514092k used, 3575652k free, 52508k buffers
Swap: 10481656k total, 0k used, 10481656k free, 184456k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2496 bg 20 0 430m 41m 6984 S 93 1.0 98:52.73 APP1
2455 bg 20 0 465m 61m 6984 S 75 1.5 99:55.35 APP2
2507 bg 20 0 430m 49m 6880 S 75 1.2 96:21.07 APP3
2444 bg 20 0 401m 27m 6984 S 58 0.7 92:10.49 APP4
2518 bg 20 0 412m 47m 6880 S 51 1.2 92:22.14 APP5
2403 bg 20 0 358m 9.9m 6880 S 49 0.2 92:06.77 APP6
2751 bg 20 0 2544 1212 928 R 0 0.0 0:00.04 top
1261 bg 20 0 5772 3164 1584 S 0 0.1 0:00.44 bash
1281 bg 20 0 8280 1508 908 S 0 0.0 0:00.21 sshd
1282 bg 20 0 4136 2868 1440 S 0 0.1 0:00.15 bash
1346 bg 20 0 3104 2036 696 S 0 0.0 0:00.32 sftp-server
2551 bg 20 0 2544 1216 928 S 0 0.0 0:18.53 top
[ 本帖最后由 sugar 于 2010-5-12 16:26 编辑 ] |