Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use arthas+jprofiler to do complex Link Analysis

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

How to use arthas+jprofiler to do complex link analysis, I believe that many inexperienced people do not know what to do. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Background

Arthas is Alibaba's open source application diagnosis tool, which provides profiler commands to generate hot flame maps. The performance analysis is done by sampling and recording calling links, which greatly improves the efficiency of online troubleshooting performance problems.

However, there is a problem, when the svg file exported by async-profiler full sampling is too large, it is very difficult to find the key call point.

For example, the following figure:

There is no way to do aggregation or filtering, local profiler tools such as jprofiler and yourkits are much more convenient, is there any way to combine the two?

After analysis, it is found that async-profiler supports output in jfr (Java Flight Recorder) format, and jprofiler also supports opening jfr snapshots. The specific steps are as follows:

1. Arthas sampling to generate jfr file

After starting arthas, execute the following sampling command:

Profiler start-f / home/admin/yourAppName/target/arthas-output/%t.jfr-d 180

% t represents the current time, followed by the number of seconds sampled.

two。 Download jfr to local

You can use oss to dump, or szrz and other ways to pour to the local.

3. Jprofiler analysis

When doing performance analysis, we often want to find out who is calling me and who calls me the most. Here is an example of how to do it.

3.1 Open Snapshot

Use jprofiler to open the jfr file, select Open a snapshot, and then select CPU views.

3.2 reverse analysis

View-> Find to find the class and method to analyze, and then select Analyze-> Calculate Backtraces to Selected Method:

3.3 Analysis results

By changing Summation mode to Total times, you can see which upstream calls this method is called, the amount of call and the proportion.

After reading the above, have you mastered how to use arthas+jprofiler to do complex link analysis? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report