CPU: 2 cores, Memory: 8192 MB, bandwidth: 10 Mbps open the website homepage press and hold f5, refresh all the time, and then 502. Mysql uses the Internet, but mysql does not. The other is a 2-core instance with 2048 memory and 2 Mbps bandwidth. If you have never used lnmp, you will not be able to refresh it. If the same problem occurs, the CPU is 2 cores, the memory is 8192 MB, and the bandwidth is 10 Mbps.
Open the home page, press f5, refresh, and then 502. Mysql uses the Internet, but mysql does not.
The other is a 2-core instance with 2048 memory and 2 Mbps bandwidth. If you have never used lnmp, you will not be able to refresh it.
Have you ever encountered the same problem? please advise.
Ps: The lnmp installation package is used in an environment that will die after a refresh.
Reply content:
CPU: 2-core, Memory: 8192 MB, bandwidth: 10 Mbps
Open the home page, press f5, refresh, and then 502. Mysql uses the Internet, but mysql does not.
The other is a 2-core instance with 2048 memory and 2 Mbps bandwidth. If you have never used lnmp, you will not be able to refresh it.
Have you ever encountered the same problem? please advise.
Ps: The lnmp installation package is used in an environment that will die after a refresh.
HTTP Status 502 (incorrect Gateway)
The gateway or proxy server receives an invalid response from the upstream server.
Solution:
1. improve the response speed of the Web server, that is, reduce the internal call relationship. you can cache the required pages, materials, or data in the memory. it can be a dedicated cache server, you can also cache the Web server to improve the response speed;
2. for network bandwidth problems, compress the transmitted data packets or apply to the IDC to increase the bandwidth;
3. internal network faults or setup problems, that is, internal network congestion, which may be caused by a large amount of internal data calls or interactions, you need to optimize internal network transmission or protocols;
4. database data reading causes front-end servers to slow down responses to user requests. Therefore, the database processing capability must be improved. for read-only services, the data cache mode can be increased or the database backup server can be increased to relieve the read pressure.
Check the nginx error. log for any error information.
Maximum number of nginx connections
Is php-fpm connection exhausted? optimize the php-fpm parameter
Is there a problem with your code? if there is an endless loop in the code or there is a very late memory operation, this problem may occur.
Division analysis steps:
1. test with a static page
2. test with a pure PHP script, without cache or DB connection
3. analyze the databases, caches, and called third-party services used by the backend one by one.
4. the common cause of 502 is that the fastcgi process crashes for some reason. you can check the PHP-fpm log.