search
HomeJavajavaTutorialAlibaba Cloud ARMS diagnoses Java application stuck problems in practice

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.

Alibaba Cloud ARMS diagnoses Java application stuck problems in practice

#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.

Alibaba Cloud ARMS diagnoses Java application stuck problems in practice

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.

Alibaba Cloud ARMS diagnoses Java application stuck problems in practice

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.

Alibaba Cloud ARMS diagnoses Java application stuck problems in practice

• 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.

Alibaba Cloud ARMS diagnoses Java application stuck problems in practice

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

Since using Qiniu After using Cloud Robots, Baidu cannot crawl it. Diagnostics show robots disabled. What went wrong?

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
JVM performance vs other languagesJVM performance vs other languagesMay 14, 2025 am 12:16 AM

JVM'sperformanceiscompetitivewithotherruntimes,offeringabalanceofspeed,safety,andproductivity.1)JVMusesJITcompilationfordynamicoptimizations.2)C offersnativeperformancebutlacksJVM'ssafetyfeatures.3)Pythonisslowerbuteasiertouse.4)JavaScript'sJITisles

Java Platform Independence: Examples of useJava Platform Independence: Examples of useMay 14, 2025 am 12:14 AM

JavaachievesplatformindependencethroughtheJavaVirtualMachine(JVM),allowingcodetorunonanyplatformwithaJVM.1)Codeiscompiledintobytecode,notmachine-specificcode.2)BytecodeisinterpretedbytheJVM,enablingcross-platformexecution.3)Developersshouldtestacross

JVM Architecture: A Deep Dive into the Java Virtual MachineJVM Architecture: A Deep Dive into the Java Virtual MachineMay 14, 2025 am 12:12 AM

TheJVMisanabstractcomputingmachinecrucialforrunningJavaprogramsduetoitsplatform-independentarchitecture.Itincludes:1)ClassLoaderforloadingclasses,2)RuntimeDataAreafordatastorage,3)ExecutionEnginewithInterpreter,JITCompiler,andGarbageCollectorforbytec

JVM: Is JVM related to the OS?JVM: Is JVM related to the OS?May 14, 2025 am 12:11 AM

JVMhasacloserelationshipwiththeOSasittranslatesJavabytecodeintomachine-specificinstructions,managesmemory,andhandlesgarbagecollection.ThisrelationshipallowsJavatorunonvariousOSenvironments,butitalsopresentschallengeslikedifferentJVMbehaviorsandOS-spe

Java: Write Once, Run Anywhere (WORA) - A Deep Dive into Platform IndependenceJava: Write Once, Run Anywhere (WORA) - A Deep Dive into Platform IndependenceMay 14, 2025 am 12:05 AM

Java implementation "write once, run everywhere" is compiled into bytecode and run on a Java virtual machine (JVM). 1) Write Java code and compile it into bytecode. 2) Bytecode runs on any platform with JVM installed. 3) Use Java native interface (JNI) to handle platform-specific functions. Despite challenges such as JVM consistency and the use of platform-specific libraries, WORA greatly improves development efficiency and deployment flexibility.

Java Platform Independence: Compatibility with different OSJava Platform Independence: Compatibility with different OSMay 13, 2025 am 12:11 AM

JavaachievesplatformindependencethroughtheJavaVirtualMachine(JVM),allowingcodetorunondifferentoperatingsystemswithoutmodification.TheJVMcompilesJavacodeintoplatform-independentbytecode,whichittheninterpretsandexecutesonthespecificOS,abstractingawayOS

What features make java still powerfulWhat features make java still powerfulMay 13, 2025 am 12:05 AM

Javaispowerfulduetoitsplatformindependence,object-orientednature,richstandardlibrary,performancecapabilities,andstrongsecurityfeatures.1)PlatformindependenceallowsapplicationstorunonanydevicesupportingJava.2)Object-orientedprogrammingpromotesmodulara

Top Java Features: A Comprehensive Guide for DevelopersTop Java Features: A Comprehensive Guide for DevelopersMay 13, 2025 am 12:04 AM

The top Java functions include: 1) object-oriented programming, supporting polymorphism, improving code flexibility and maintainability; 2) exception handling mechanism, improving code robustness through try-catch-finally blocks; 3) garbage collection, simplifying memory management; 4) generics, enhancing type safety; 5) ambda expressions and functional programming to make the code more concise and expressive; 6) rich standard libraries, providing optimized data structures and algorithms.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Atom editor mac version download

Atom editor mac version download

The most popular open source editor