试图在uWSGI中设置请求的超时,我不确定设置是否正确.似乎有多个超时选项(套接字,接口等),并且不容易明白要配置哪个设置或在哪里设置它.
我正在寻找的行为是将请求的时间延长到REST应用程序的资源层.
我正在运行 Django、uwsgi、ngix 服务器。我的服务器适用于较小尺寸的 GET、POST 请求。但是在POST大尺寸的请求时,nginx返回502:nginx error.log是:
2016/03/01 13:52:19 [error] 29837#0: *1482 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 175.110.112.36, server: server-ip, request: "POST /me/amptemp/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/uwsgi.sock:", host: "servername"
Run Code Online (Sandbox Code Playgroud)
因此,为了找到真正的问题所在,我在不同的端口上运行 uwsgi 并检查同一请求是否发生任何错误。但是请求成功了。因此,问题出在 nginx 或 unix 套接字配置上。Ngin-x 配置:
# the upstream component nginx needs to connect to
upstream django {
server unix:///tmp/uwsgi.sock; # for a file socket
# server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server …
Run Code Online (Sandbox Code Playgroud)