Node JS processing time Analysis

Source: Internet
Author: User

Conclusion: The request time in the PM2 log contains the connection settling time to the processing end time.

There is a strange problem today. The same Nodejs program is deployed in two environments where the PM2 print server response time for an environment is a few milliseconds, and the PM2 print server response time for another environment is dozens of/hundreds of or even thousands of milliseconds. The deployment server configuration of the two environments is consistent, the software environment is consistent, the only difference is that a environment uses nginx to do reverse proxy, B environment is the use of the load balancer to do reverse proxy.

Finally, the response time in two logs is different because nginx, as the reverse proxy, will send the HTTP request all over again, and the load balancer of Qingyun is constantly sending the request packet to the service.

The logs for the server of the Load Balancer agent for Qingyun are as follows:

23:27:05.892857 IP 10.80.32.99.43129 > 192.168.10.5.3012:flags [S], seq 3297605978, Win 14600, op

23:27:05.977404 IP 192.168.10.5.3012 > 10.80.32.99.43129:flags [.], ACK 19498, win 326, options

23:27:05.991372 IP 192.168.10.5.3012 > 10.80.32.99.43129:flags [P.], seq 26:208, Ack 19498, Win 32

This is the time to grab the bag, which costs a total of 99ms.

892-977 is to receive data, altogether spent 85ms, 977-991 is processing data, spent 14MS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.