Cpu:2 Core, Memory: 8192 MB, Bandwidth 10Mbps
Open the website home page hold F5, always refresh and then 502. MySQL is using the extranet, MySQL is not hanging.
The other one is 2 cores, the memory is 2048, the bandwidth is 2m. has not used Lnmp, refresh on the brush does not die.
Do you have a friend who has the same problem, ask for advice?
PS: A refresh of the dead environment with the LNMP installation package
Reply content:
Cpu:2 Core, Memory: 8192 MB, Bandwidth 10Mbps
Open the website home page hold F5, always refresh and then 502. MySQL is using the extranet, MySQL is not hanging.
The other one is 2 cores, the memory is 2048, the bandwidth is 2m. has not used Lnmp, refresh on the brush does not die.
Do you have a friend who has the same problem, ask for advice?
PS: A refresh of the dead environment with the LNMP installation package
HTTP Status 502 (Error Gateway)
The server received an invalid response from the upstream server as a gateway or proxy.
Workaround:
1. Improve the response speed of the Web server, that is, reduce the internal call relationship, you can put the required pages, footage or data, in memory, can be a dedicated cache server, or the WEB server itself cache, to improve response speed;
2. The network bandwidth problem, the transmission of the packet compression processing, or to IDC application to increase the bandwidth;
3. The internal network is a fault or setup problem, that is, internal network congestion, there may be a large number of internal data calls or interactions caused by the need to optimize the internal network transmission or protocol;
4. Database data read caused by the front-end server, in response to the user's request is slow, you must improve the database processing capacity, if the read-only business can increase the data cache mode or increase the database standby machine, decentralized reading pressure
Look at Nginx error.log log, there is no error message
Nginx limit maximum number of connections
is not php-fpm the number of connections exhausted, optimize the PHP-FPM parameter
is not your code is a problem ah, if the code there is a dead loop, or a very late memory operation, there is a possibility that this problem
Elimination Method Analysis steps:
1. Test with Static page
2, with pure PHP script test, not even cache, non-connected DB
3, each analysis of the backend used to the DB, cache, call the third-party service is normal
4, 502 is usually due to the fastcgi process for some reason hanging off, you can look at the PHP-FPM log