current position:Home>Performance problem analysis guide for enterprise JavaScript applications running in production systems

Performance problem analysis guide for enterprise JavaScript applications running in production systems

2022-04-29 06:47:24Game programming

Enterprise class JavaScript After the application is deployed in the production system and running , If there is a performance problem , Then find out the root cause of these performance problems , It's often not as simple as finding the root cause of runtime failures or exceptions .JavaScript The performance problem of applications is often manifested in the decline of user request response time , Reduction or even depletion of available resources of the system .
This paper takes an open source e-commerce Storefront Enterprise application Spartacus For example , Let's share JavaScript When the application encounters performance problems in the production system , How should developers analyze possible causes .

 Enterprise class running in the production system JavaScript Application performance problem analysis guide - The first 1 Zhang

When the user initiates a pair in the browser Storefront After your access request , It will be processed through the following components . So in theory , All of these components can be one of the root causes of performance problems .

  • Load balancing server

  • function JavaScript Storefront Of Web Server( such as Nginx,Apache)

  • Server.js:JavaScript Storefront Implementation running in server-side rendering mode

  • CDN

  • API The server

  • Database we can use Dynatrace This powerful platform to analyze JavaScript Application execution performance data .Dynatrace The service menu in is the recommended entry to start performance analysis , Because you can see the performance data of all the above components here .

 Enterprise class running in the production system JavaScript Application performance problem analysis guide - The first 2 Zhang

A recommended way to visualize all components and their response time contributions , Start as far as possible from the outermost layer of the call , namely JavaScript Storefront Run the corresponding website Apache service , In this case www.demo.com:443.
Click the icon on the right ... And select Service Flow. In the following page , It's best to narrow down the analysis time to a time window with obvious performance problems . Another way to add a response time filter , Focus only on those requests with the slowest response time .
for example , Set the filter response time >= 6s, It will be allowed to visualize only those whose response times are equal to or greater than 6 Second request hotspot .

 Enterprise class running in the production system JavaScript Application performance problem analysis guide - The first 3 Zhang

It's important to note that ,Service Flow Each node shown in the diagram depends on the previous node , Therefore, when analyzing the performance data of a time period , It is possible that the response time percentage of several adjacent nodes is usually very high , Until you encounter a service with real performance problems . for example , If the performance bottleneck is the database , Then all layers before it will also participate in the overall contribution , Even if they are simply waiting for the end of the database operation .
for example , In the scene shown above , The bottleneck seems to be Node.js Applications , Because the percentage of response time decreases , It happened in this Node.js After procedure .
By clicking on any layer and using ... Button , Select the response time hotspot option , You can view individual contributors at each level . for example , from www.demo.com:443 Start , We found a specific request , Contribute the most to the overall response time percentage .
Since our guess is Node.js Performance problems caused by application , You can view it further jsapps Performance data for , Here's the picture , Its Code Execution It cost 6.19 second .

 Enterprise class running in the production system JavaScript Application performance problem analysis guide - The first 4 Zhang

Click on the Code Execution, Go to the details page , Click again ... Keep looking at , Until the response time 6.19 s The line with the most contribution calls .
author :JerryWangSAP

Game programming ️, A game development favorite ~

If the picture is not displayed for a long time , Please use Chrome Kernel browser .

copyright notice
author[Game programming],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/116/202204260850284753.html

Random recommended