Django uwsgi collapse resulted in 502 error

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Django uwsgi collapse resulted in 502 error


1 request requests data is too large

The first set harakiri timeout is 60, cause uwsgi to crash restart, solution prolongation of harakiri time, or comment out the harakiri configuration request, look at how long it will take

harakiri

This option sets the harakiri timeout (related content can see wiki page). If a request takes longer than the harakiri timeout, then the request will be abandoned, and the current processing the request work process will be recycled (or restart).

--harakiri 60

This setting will cause the uwsgi to discard all takes 60 seconds to complete the processing of the request.

2 uwsgi requires a relatively long time, resulting in nginx at 502 gateway timeout error


The solution, change the nginx configuration, to extend the nginx to the uwsgi request of read and send timeout time, play a role in the read time out time setting


location /api/ {
uwsgi_pass django;
include uwsgi_params;
uwsgi_read_timeout 1800;
uwsgi_send_timeout 300;
proxy_read_timeout 300;
}


Reprint

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Moses at December 28, 2013 - 5:08 PM