Linux???CPU???????
???????????? ???????[ 2016/12/19 11:40:29 ] ?????????????? Linux
????????????????????issue??????????????????????????CPU????????????????????????????????????????п???? ?????????????
????1.??top???????????????CPU??
????gateway???????14094???CPU???891%????????????????????????CPU????????
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14094 root 15 0 315m 10m 7308 S 891% 2.2 1:49.01 gateway
20642 root 17 0 17784 4148 2220 S 0.5 0.8 2:39.96 microdasys
1679 root 18 0 10984 1856 1556 R 0.3 0.4 0:22.21 sshd
22563 root 18 0 2424 1060 800 R 0.3 0.2 0:00.03 top
1 root 18 0 2156 492 460 S 0.0 0.1 0:01.59 init
????2.??top -H -p pid?????????????????????CPU????
????#top -H -p 14094
????top?п????????107??????????????9????????CPU?????????????14086??????????????high CPU
PID USER PR NI VIRT RES SHR S %CPU MEM TIME+ COMMAND
14086root 25 0 922m 914m 538m R 101 10.0 21:35.46 gateway
14087 root 25 0 922m 914m 538m R 101 10.0 10:50.22 gateway
14081 root 25 0 922m 914m 538m S 99 10.0 8:57.36 gateway
14082 root 25 0 922m 914m 538m R 99 10.0 11:51.92 gateway
14089 root 25 0 922m 914m 538m R 99 10.0 21:21.77 gateway
14092 root 25 0 922m 914m 538m R 99 10.0 19:55.47 gateway
14094 root 25 0 922m 914m 538m R 99 10.0 21:02.21 gateway
14083 root 25 0 922m 914m 538m R 97 10.0 21:32.39 gateway
14088 root 25 0 922m 914m 538m R 97 10.0 11:23.12 gateway
????3.???gstack??????????и??????????????
????#gstack 14094 > gstack.log
??????gstack.log?в??????ID14086???????????????????????????????????????壬???ID14086?????????37
????Thread 37 (Thread 0x4696ab90 (LWP 14086)):
????#0 0x40000410 in __kernel_vsyscall ()
????#1 0x40241f33 in poll () from /lib/i686/nosegneg/libc.so.6
????4.???gcore??????????????????????
????#gcore 14094
??????????????core???core.14094
????5.??strace??????????ú????????
????#strace -T -r -c -p 14094
????-c??????????????????????????????????????????估???????
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------------------
99.99 22.683879 3385 6702 poll
0.00 0.001132 0 6702 gettimeofday
0.00 0.000127 1 208 208 accept
0.00 0.000022 22 1 read
0.00 0.000000 0 1 write
0.00 0.000000 0 1 close
0.00 0.000000 0 14 time
0.00 0.000000 0 2 stat64
0.00 0.000000 0 4 clock_gettime
0.00 0.000000 0 7 send
0.00 0.000000 0 10 10 recvfrom
------ ----------- ----------- --------- --------- ------------------------------
100.00 22.685160 13652 218 total
????6.??gdb????core???????????л???37?????
????gcore??????core dump???????core????????????????????gdb?????Щ???????
(gdb) gdb gateway core.14094 (gdb) thread 37 [Switching to thread 37 (Thread 0x4696ab90 (LWP 14086))]#0 0x40000410 in __kernel_vsyscall () (gdb) where #0 0x40000410 in __kernel_vsyscall () #1 0x40241f33 in poll () from /lib/i686/nosegneg/libc.so.6
????????????????????????gdb?????????Щ??????????????????????λ?poll??????ú???CPU??
????????????漰??????????????????????????????????????????????????????
???????????????ID->???ID->???????????->???????????????->????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11