Alibaba Cloud ARMS diagnoses Java application stuck problems in practice
Don’t panic, this is just a picture
Besides the 404, this picture may be the most distressing to netizens.
We welcome netizens to leave messages in the background of the "Alibaba Middleware" public account and send us the heartbreaking things you see on the Internet. It is not limited to text, pictures and voices. Maybe we will push it. This is the "Internet Heartache Collection".
According to relevant research, when the page loading time increases from 1 second to 3 seconds, the chance of jumping out increases by about 30%. The chance of 1s to 5s increases to 90%. If your website takes 10s to load, the chance of bounce will exceed 120%. (The 120% here does not mean 10 people come and 12 people leave, it means the growth rate of user churn.) Therefore, in this era of "user experience is king", application performance monitoring has become the top priority of operation and maintenance management.
1. Find the cause of “slowness”.
Website lag and slow page loading are common problems in Internet applications. It is not easy to troubleshoot and solve such problems, and it will cost operation and maintenance personnel a lot of time and energy. There are usually three reasons:
» The application link is too long and there is no way to start.
From the front-end page to the back-end gateway, from the Web application server to the back-end database, problems in any link may cause the overall request to be stuck. Is the front-end resource loading too slow? Or is there something wrong with the database? Or does the newly released server code have performance issues? Problems can occur for a variety of reasons.
For applications that use a "microservice" architecture, the links are more complex. Different components may be maintained by different teams and personnel, which makes troubleshooting more difficult.
» The log is incomplete or of poor quality, and the scene is missing.
Application log is undoubtedly an artifact for troubleshooting online problems, but the location of the problem is often unpredictable. When a problem occurs, it is usually found that the log information is incomplete because we cannot print every place where a problem may occur. log.
The definition of "slow" is subjective, and "slow" is sometimes an accidental phenomenon. To really capture the "slow" line of code, we often need to record every call and not miss every line of code, but this approach is too costly.
» Insufficient monitoring means it’s too late when problems arise.
Rapid business development and faster iteration speed will lead to frequent interface modifications of the business system, increased dependencies, and deterioration of code quality. If there is not a complete monitoring system that can fully automatically monitor the performance of each interface of the application and automatically record problematic calls, it will be too late to solve the problem after user feedback.
2. How to locate "slow" problem in 1 minute
Business real-time monitoring service ARMS (Application Real-Time Monitoring Service) is a full-link Alibaba Cloud Application Performance Management (APM) class Monitor products. ARMS provides a full range of monitoring functions for Java application monitoring and diagnosis, Internet of Vehicles real-time monitoring, retail industry real-time monitoring, user experience monitoring and other scenarios, including front-end monitoring, application monitoring and custom monitoring functions to quickly build real-time business Monitoring capabilities.
Step one: Install Java probe (if your application is hosted on EDAS, you can even skip this step)
• Open ARMS and create an application.
• Download the Java probe package and unzip it.
• Add -javaagent:/{user.workspace}/ArmsAgent/arms-bootstrap-1.7.0-SNAPSHOT.jar-Darms.licenseKey=xxx -Darms.appId=xxx ( Fill in the appId and licenseKey according to the information assigned on the page)
• Open the ARMS page, data begins to be reported, and verify that the Java probe is successfully installed.
#Step 2: Find "slow" suspicious clues in the application overview
Enter the ARMS application topology diagram. In the application overview, we can clearly see that there are "slow SQL" 5 times in the system today.
Step 3: Browse and find the "slow interface"
Click on the interface list, we can see at a glance what this application provides All interfaces as well as the number of calls and time-consuming of this interface. Of course, these interfaces are automatically discovered by ARMS probes in the program without any configuration.
Among these interfaces, the "slow" interface will be clearly marked. We clearly found a suspiciously slow interface.
Select the "slow" interface with the most calls on the left. We can see from the right that this call is obviously "slow" in the database call.
Step 4: “Which line of code is slow”? Locate the reason with one click!
• It’s not enough to just see how long the interface takes, we need to accurately locate the line of code where “slowness” occurs.
• Click "Interface Snapshot" to see the snapshots of all interfaces corresponding to this interface. The snapshot is a complete record of the full link call of a call. The ARMS probe will record the code and time taken by each call with very small performance loss, helping you pinpoint "slow" problems.
• We click on the TraceId of a certain call snapshot and expand it to see which row is specifically "slow" for this call. From the picture above, we can clearly see that in this call that took 705 milliseconds, most of the time was spent in the "SELECT * FROMl_employee" SQL call, which is obviously a full table scan operation. !
• So far, we have clearly discovered the root cause of a slow call error in the system. And there is sufficient basis to guide our next step of code optimization work. We can also go back to the calling interface list, and then open other "slow" calls in the list one by one, and solve them one by one. I believe that with the help of ARMS, your website will be able to stay away from the trouble of lag and provide users with a smoother experience.
Step 5: Take preventive measures before they happen - set alarms
Of course, you can set alarms for a certain interface or all interfaces in the alarm settings of ARMS. Let your operation and maintenance team be notified immediately when the page interface is stuck.
3. What other website experience issues are there?
Of course, in addition to website lags and slow page loading, the website will also have a series of problems such as background errors, page loading failures, and memory leaks. How to use ARMS to quickly solve more website problems, please pay attention to our ARMS series of articles - "One-minute location of common website problems".
Related recommendations:
mysql-Alibaba Cloud-RDS-MySQL-5.5 calculation problem
The above is the detailed content of Alibaba Cloud ARMS diagnoses Java application stuck problems in practice. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The steps to build a MySQL database include: 1. Create a database and table, 2. Insert data, and 3. Conduct queries. First, use the CREATEDATABASE and CREATETABLE statements to create the database and table, then use the INSERTINTO statement to insert the data, and finally use the SELECT statement to query the data.
