502 Bad Gateway how to solve?

The reason is the 502: a response to user requests access timeout caused

Server solution:

1. improve the response speed of the Web server, but also a reduction of relations within the call, you can put the pages you need, material or data cached in memory, which can be dedicated cache server or Web cache server itself, improve the response speed ;

2. The problem of network bandwidth, the transmission of data packets to compression processing, or to increase the bandwidth request IDC;

3. a malfunction or internal network setup issues, namely internal network congestion, there may be a lot of internal data call or interaction caused by the need to optimize the internal network or transport protocols;

4. The resulting data read database front-end server, slow response to user requests, it is necessary to increase the processing capacity of the database, if read only data traffic can be increased to increase the cache mode or the database backup server, a dispersion pressure reading;

If the pressure of writing, you might consider a delay write mode, want to do this when writing data dispersed certainly too late



Client Solution

Popular explain
1. What is the 502 bad gateway error
502 is simply given bad gateway type code error gateway.
 
2. The cause of the error
Connection timeout we send a request to the server because the server is currently linked too much, causing the server can not give respect to a normal response, generate such an error
 
3. rescue measures
The best solution of course, is unlikely to do for all of us on the server
So we have to save what way?
To put it plainly very simple
Is - refresh (not a general refresh oh)
 
Refresh principle: Many people may not know it is there are two refresh.
In fact, the so-called refresh local memory or hard disk buffer is downloaded from the server to the data,
And then read data from local memory or hard disk to the browser displays to us.
 
① Basic Refresh: Click Refresh or using the F5 is the shortcut key
The basic refresh may just re-pick data from a browser to a local hard disk, not necessarily reissue the request to the server.
Most users most of the time so refresh encountered 502 error would have no effect.
 
② from the server refresh: If you re-direct click on the link you want to browse the web, you will find the show "502 bad gateway" error message page can browse normally and then click on the link.
To understand the truth, right? When you click on the link on the page you want to view the time, it will re-download data from the server.
The solution is flushed from the server: shortcut keys ctrl + F5, this is to re-send the request to the server.
If the server can give you the normal response you can see the page of.

 

Guess you like

Origin www.cnblogs.com/ryanzheng/p/11018510.html