Site Refresh 10 seconds is 502 What is the problem, the server configuration is very high

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

  • Related Article

    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.