Author | feather alibaba CCO technology technical experts, bear the CCO tech architecture governance, basic construction work, keen on open source technologies, like for electronic products.
Arthas official community is holding an essay call for prizesClick on the submit】
background
Arthas is an open source application diagnostics tool from Alibaba that provides profiler commands to generate hot flame maps. Performance analysis is performed by sampling, recording, and calling links, which greatly improves the efficiency of online performance troubleshooting.
There is a problem, however, when the SVG file exported by async-Profiler full sampling is too large, it is very difficult to find the key call points.
Here’s an example:
There is no way to aggregate or filter. Native profiler tools such as JProfiler and YourKits are much more convenient. Is there a way to combine the two?
Async-profiler supports JFR (Java Flight Recorder) format output, jprofiler also supports JFR snapshot. The specific operation steps are as follows:
1. Arthas sampling generates JFR files
Once arthas is started, execute the following sampling command:
profiler start -f /home/admin/yourAppName/target/arthas-output/%t.jfr -d 180
Copy the code
% t says the current time, behind – d sampling number of seconds, see more parameters: alibaba. Making. IO/arthas/initial…
2. Download JFR to the local PC
Can use OSS inversion, or SZRZ and other ways to the local inversion.
3. Analysis of jprofiler
When we do performance analysis, we often want to find out who is calling me and who is calling me the most. Here’s an example of how to do it.
3.1 Opening a Snapshot
Open the JFR file with jprofiler, select Open a snapshot, and then select CPU Views:
3.2 Reverse Analysis
Select Analyze -> Calculate Backtraces to Selected Method:
3.3 Analysis Results
If you change the Summation mode to Total times, you can see the number of upstream calls to the method.
conclusion
- Generated by the Arthas profiler command
jfr
File; - Pass locally
jprofiler
To analyze thejfr
File, locate who is calling me; - The best thing to do is to save. The combination of tools can produce wonderful chemical reactions.
Arthas’s essay campaign is in full swing
Arthas is officially holding an essay call if you have:
- Problems identified using Arthas
- Source code interpretation of Arthas
- Advise Arthas
- No limit, other Arthas related content
Welcome to participate in the essay activity, there are prizes to win oh ~ click to submit
“Alibaba Cloud originator focuses on micro-service, Serverless, container, Service Mesh and other technical fields, focuses on the trend of cloud native popular technology, large-scale implementation of cloud native practice, and becomes the public account that most understands cloud native developers.”