In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the Linux X-ray service CPU100% problem how to deal with, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Functional problems, through the log, single-step debugging is relatively easy to locate.
Performance issues, such as online server CPU100%, how to find relevant services, how to locate the problem code, more test the skills of technical people.
58 to the home architecture department, the operation and maintenance department, and the 58 express technology department jointly conducted an online service CPU problem troubleshooting exercise. The students' feedback was fruitful. I hope it will be helpful to all of you.
Title
Several tomcat instances, namely several vertically segmented Java site services and several Java microservices, were deployed on a server, and suddenly received an abnormal CPU alarm from the operation and maintenance staff.
Q: how do I locate which service process is causing CPU overload, which thread is causing CPU overload, and which code is causing CPU overload?
Step 1. Find the process that consumes the most CPU
Tool: top
Methods:
Execute top-c to display a list of process running information
Type P (uppercase p), and processes are sorted by CPU utilization
The figure shows:
As shown in the figure above, the process that consumes the most CPU has a PID of 10765
Step 2: find the thread that consumes the most CPU
Tool: top
Methods:
Top-Hp 10765, which displays a list of thread running information for a process
Type P (uppercase p), and threads are sorted by CPU utilization
The figure shows:
As shown in the figure above, within process 10765, the thread that consumes the most CPU has a PID of 10804.
Step 3: convert the thread PID to hexadecimal
Tool: printf
Method: printf "% x\ n" 10804
The figure shows:
As shown in the figure above, 10804 corresponds to 0x2a34 in hexadecimal, which, of course, can be done with a calculator.
The reason for converting to hexadecimal is that the thread id is represented in hexadecimal in the stack.
Step 4: check the stack to find out what the thread is doing
Tool: pstack/jstack/grep
Method: jstack 10765 | grep '0x2a34'-C5-- color
Print process stack
Through thread id, the thread stack is filtered.
The figure shows:
As shown in the figure above, the thread name "AsyncLogger-1" corresponding to the thread with high CPU consumption is found, and the stack on which the thread is executing code is seen.
Thank you for reading this article carefully. I hope the article "how to deal with CPU100% on Linux X-ray Service" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.