In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "what is ARMS Arthas diagnosis". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
First of all, let's take a look at a basic step for us to troubleshoot online problems, which is generally the step for troubleshooting most online problems.
Step 1: find the input that can reproduce the problem
Step 2: determine whether the input can be constructed in the daily environment, and if so, adjust to step 5. If not, proceed to step 3
Step 3: check the online environment log to see if you can find the exception log related to the exception input to assist in troubleshooting the problem.
Step 4: initially infer the cause of the problem, try to fix it and add more log output. Then package and release. Repeat step 3 until the root cause is located
Step 5: daily construction of the same input, single point debugging, positioning problems
In the actual scene, because of the isolation of the online and offline environment, the online input is often difficult to construct in the daily environment, most of the time we cycle in steps 2, 3, 4, so time passes slowly in the cycle.
In fact, the purpose of doing so many steps above is to find out what the input, output and exception of a piece of code are when the execution of a piece of code does not meet expectations. And the specific execution of each line in the code. So is there a product that allows users to achieve this goal easily and quickly? The answer is yes.
Let's talk about ARMS.
Aliyun's application real-time monitoring service ARMS is an application performance management (APM) product, which includes three sub-products: application monitoring, Prometheus monitoring and front-end monitoring, covering performance management in distributed applications, container environment, browser, Mini Program, APP and other fields. It can help users achieve full-stack performance monitoring and end-to-end full-link tracking and diagnosis.
ARMS has recently introduced Arthas diagnostics, and its first version mainly includes four capabilities, namely, JVM overview, thread time analysis, method execution analysis, and performance analysis.
JVM Overview: view real-time JVM memory, GC information, as well as operating system information, environment variables, system variables and other information.
Thread time analysis: view real-time thread time, and view the real-time method stack for each thread.
Method execution analysis: real-time capture the method execution details, entry and exit parameters and exceptions that meet the specified conditions.
Performance analysis: quickly show the bottleneck of system performance in the form of flame diagram.
The Arthas function of ARMS is also relatively easy to use. For details, please refer to the documentation (https://help.aliyun.com/document_detail/204809.html). Let's briefly talk about how to use ARMS's Arthas diagnostic capabilities to locate online problems.
Talk about ARMS Arthas diagnosis
The previous section briefly introduced the capabilities of ARMS's Arthas diagnostics, so what online problems can be solved with these capabilities? Here, we summarize the online problems and divide them into the following four categories:
The execution of the method does not meet the expectations, including the time-consuming execution of the method, the return value of the method, the exception thrown by the method, etc., which may be manifested in the application of increased RT of some interfaces or services, increased error rate, abnormal return value, and so on.
There is a sudden increase in process CPU time: generally, there are code endless loop problems, high time consumption of GC threads caused by FullGC, concurrent use of HashMap, and so on.
Performance optimization problems: mainly used to analyze performance bottlenecks and assist performance optimization, including CPU time-consuming, memory allocation, lock competition, itimer and other performance analysis.
Other problems: such as initialization environment variable read error, kernel version does not meet the requirements, class conflicts and so on.
Here is an actual demo to demonstrate how to use ARMS's Arthas to diagnose problems that do not meet expectations, and subsequent articles will continue to describe how to use Arthas to diagnose other types of problems.
Using ARMS Arthas diagnostic method to execute problems that do not conform to expectations
Problem background: com.alibabacloud.hipstershop.productserviceapi.service.ProductService@confirmInventory of product application
The average RT of the API reaches 400 after a release, and the average RT before release is below 1ms, as shown in the following figure. Now I want to locate exactly where the time is spent.
First, go to the page of ARMS Arthas diagnostics. When we locate the Bug, we first need to know the class name and method name of the problem, and enter the corresponding class name and method name according to the red comments in the screenshot. If you are an EDAS user, you can directly select a service or interface, and the background will automatically infer the corresponding implementation classes and methods. Corresponding to this case, the corresponding class is com.alibabacloud.xxx.xxx.xxx.ProductService and the method is confirmInventory. Click OK when you are finished.
As shown in the following figure, click OK to get the record of the execution of the confirmInventory method, including the input parameters of the execution, the exception returned, and the details of the method execution.
But this execution takes 2.89 ms, which is not the high time-consuming call we expected. At this point, you can click the upper right corner to modify the diagnostic parameters and set the method calls that take longer than 300ms (in addition, you can also set more filtering conditions, including the conditions that the method parameters meet, etc., for more information, please see the document).
After clicking OK, click the refresh icon in the upper right corner to diagnose again. This time, a time-consuming 1501ms method call was fetched, and it was found that the Thread.sleep () method was executed during the execution of the method.
At this point, you may also wonder why the sleep method is executed. What is the logic of this code? Click on the upper right corner to view the method source code, and combine the method source code with the method execution details at a glance. As shown in the following figure, each method call performed in the confirmInventory method ends up showing the time-consuming execution of the method with the prefix "/ / -".
In addition, you can click on figure 5, drill down in the operation column on the far right of the list, and quickly analyze the execution of the submethods called by confirmInventory. This is very convenient and easy to use in scenes with deep roots.
At this point, we have completed a positioning demonstration of this problem.
I believe that the Arthas diagnosis function of ARMS must have left a deep impression on you, and it will certainly become a sharp tool for your online problem diagnosis, helping you diagnose online faults faster and more conveniently.
This is the end of the content of "what is ARMS Arthas diagnosis". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.