In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how to use JVM monitoring and analysis tools in UAVStack". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use JVM monitoring and analysis tools in UAVStack".
Introduction
As the intelligent service technology stack of AllInOne, UAVStack provides a very comprehensive monitoring data sampling function, while supporting data monitoring and early warning. Recently, we have integrated the original data acquisition and display function, added JVM analysis function, and launched a more easy-to-use JVM monitoring and analysis tool.
Developers familiar with JDK know that JDK itself provides a set of JVM analysis tools, including jinfo, jmap, jstack and so on. Users can easily get JVM memory stack information, memory object allocation and JVM startup basic parameter information from the command line. However, these tools need to be executed in a command line environment and forwarded through a fortress machine in a production environment.
Some good JVM analysis tools in the open source community can also provide functions such as obtaining basic JVM information, tracking stack, obtaining memory information, etc., but they also need the support of command line CLI.
The JVM monitoring and analysis tool released by UAVStack provides a page-based display mode to graphically display the collected monitoring data; at the same time, it provides functions such as JVM basic parameters acquisition, memory dump, thread analysis, memory allocation sampling and hot method analysis.
I. structure
Based on the existing architecture of UAVStack, JVM monitoring and analysis tools are divided into front-end, background and middleware enhancement framework (MOF). Where:
The front end is responsible for displaying data and sending user execution instructions to the background.
The background is responsible for issuing instructions, responding to user queries and processing the collected data.
The Middleware Enhancement Framework (MOF) is responsible for receiving instructions issued by the background, executing instructions and returning data or writing data to a file, and then uploading data through the file collection function provided by UAV.
The overall architecture process is shown in the following figure:
2. Key technology 2.1 JMX
JMX provides relevant interfaces to obtain basic JVM monitoring data, such as memory heap size, GC, etc., which is the basis of JVM monitoring data.
2.2 Middleware enhanced Framework (MOF)
As the basis of the entire link of the analysis tool, MOF is attached to the user application and provides the following basic support:
Basic data collection: in MOF implanted applications, JMX regularly acquires and reports the basic information and data of the relevant JVM, providing a data basis for display and early warning.
Request capture, instruction execution: most of the functions of the JVM monitoring and analysis tool need to send instructions to the server where the application is located. MOF is responsible for intercepting the request for issuing instructions, executing it and returning the corresponding results.
2.3 Java Attach API
Java Attach API is a set of non-standard API provided by Sun, which can connect users to running virtual machine processes and mount agent and other operations.
In the JVM monitoring and analysis tool, Java Attach API is mainly used for the Attach-to-virtual machine process, doing the following:
Get JMX Connection: get JVMConnection from outside, get MXBean, and grab running data. (CPU sampling analysis)
Get VirtualMachine object: call the interface to get heap memory distribution information. (memory sampling Analysis)
Third, function display 3.1 basic monitoring
After selecting an application instance, you can go to the basic monitoring page.
This page mainly shows CPU usage, threading, memory footprint, and GC. Users can adjust the time range according to their needs and view the monitoring data for different periods of time.
3.2 JVM Summary
The JVM summary page displays basic parameter information for the current virtual machine, including basic information, JVM parameters, and system properties. Where:
Basic information includes the most basic and important information such as pid, host information, startup parameters and startup time of JVM.
JVM parameters include all JVM startup parameters, and users can view specified heap size, garbage collector information, etc.
System properties include all configuration information written to System.Properties and configuration properties of Javaagent.
3.3 Thread analysis
Thread analysis obtains the basic information of threads by executing jstack, and analyzes the output results to get information such as the number of thread states and whether there is deadlock or not.
3.4 memory Dump
The in-memory Dump gets the stack dump file for the specified JVM by executing jmap.
Users can easily generate dump at the front end with one click, without having to log in to the fortress machine. Click "Refresh" to view recent dump memory operations.
3.5 CPU analysis
CPU analysis is a sampling analysis based on thread stack, which mainly provides two functions: thread execution time and method hotspot sampling.
Thread execution time refers to the active time of the thread during the sampling period. The query results are sorted according to the total thread activity time, and the thread name and thread execution time information are provided at the same time, according to which the user can judge the execution of the application.
Method hotspot sampling counts the execution time of all methods and provides the class name and method name information of the method. Among them, the self-use execution time of the method does not include the execution time of the method calling other methods. The query results are sorted in descending order according to the self-use execution time of the method. Users can view the long-time execution methods within the current application to determine whether the application is abnormal and whether it needs to be optimized.
3.6 memory analysis
Memory analysis is based on thread and heap statistical sampling analysis, which mainly provides two functions: memory allocation of each thread and details of intra-heap allocation.
Thread memory allocation provides information such as the memory allocation size and thread name of each thread, sorted in descending order by memory allocation size. Users can view the threads that currently take up a lot of memory.
Intra-heap allocation provides the number of allocation instances of each class in the heap and the heap memory occupied, arranged in descending order according to the size of the heap memory. Users can use this function as a simple dump and analysis tool to quickly analyze memory allocation and find memory allocation problems.
The above is all the contents of this article entitled "how to use JVM Monitoring and Analysis tools in UAVStack". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.