我在 Google Compute 上有一个 nginx-gunicorn-flask 的设置,但是我一直从 gunicorn 得到以下错误信息:
[2019-04-19 20:50:49 +0000] [3345] [DEBUG] POST /
[2019-04-19 20:50:49 +0000] [3345] [DEBUG] Ignoring EPIPE
在100个请求中,大约有23个类似于那样。在访问日志中只显示了23个请求,它们都是200。
从nginx访问日志中显示504错误,在错误日志中我看到了这个:
2019/04/19 20:50:49 [error] 3097#3097: *295 upstream timed out (110: Connection timed out) while sending request to upstream, client: ip, server: , request: "POST / HTTP/1.1", upstream: "http://unix:/home/user/Server/server.sock/", host: "ip"
我已经尝试设置proxy_connect_timeout 75s;
proxy_read_timeout 300s;
根据其他问题的建议,我在nginx的位置和gunicorn中加入了--timeout 300
,但没有起作用。
来自gunicorn的消息并没有帮助我确定原因,我也没有找到任何相关信息。
我一直在尝试解决这个问题,希望得到任何想法。此外,每个请求需要1-2秒的时间,而jmeter则显示出现结果之前有很长的延迟。
从gunicorn的代码来看,这是一个errno.EPIPE异常,与套接字有关...