当前位置:网站首页>How to locate the cause of high CPU on the server

How to locate the cause of high CPU on the server

2022-06-09 21:26:00 Brother Ali Xiong

Recently, the production server always prompts cpu Tips for high usage , Out of interest , Check it out , Found the cause of the problem . The following is a summary of how to locate the cause CPU The height problem .

1、 Use top Command to find CPU Use the highest process

top

2、 Use top -Hp process Id , Find the most used thread

top -Hp 6962

3、 Put these threads id Convert to 16 It's binary ,printf “%x\n” Threads Id

printf "%x\n" 2846

4、jstack Print process stack information (6962 Is a process id,a33 Is the thread id It's the same as 16 Base number )

jstack 6962 | grep a33 -C5 --color

This will lead to CPU Specific code with high usage rate . Hee hee hee hee ~~~~~

原网站

版权声明
本文为[Brother Ali Xiong]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206092053449644.html