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