Why is the refresh of the website 502 in 10 seconds? the server configuration is very high.

Source: Internet
Author: User
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.

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.