gpt4 book ai didi

python - Gunicorn + nginx - 忽略 EPIPE

转载 作者:行者123 更新时间:2023-12-03 15:16:57 31 4
gpt4 key购买 nike

我有一个在谷歌计算上运行的 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 和 --timeout 300 上的位置在基于 other questions 的 gunicorn但它没有帮助。

来自 gunicorn 的消息并没有真正帮助确定原因,我没有找到任何相关信息

一直试图解决这个问题,我很感激任何想法。此外,这些请求中的每一个都需要大约 1-2 秒,并且 jmeter 显示出巨大的延迟,直到结果出现。

查看 gunicorn 的代码,这是一个与套接字有关的 errno.EPIPE 异常...

最佳答案

GunicornNGINX在同一台服务器上运行,这可能是权限问题。
检查 Gunicorn 服务器正在运行您的应用程序的用户,如 ps aux | grep gunicorn ,然后您可以相应地更改权限。
停止 NGINX ,然后运行下面的命令

chown gunicorn_user_here.nginx /var/lib/nginx/tmp/proxy -v
rm /var/lib/nginx/tmp/proxy/* -R
chmod 777 /var/lib/nginx/tmp -v
开始 NGINX并检查日志。

关于python - Gunicorn + nginx - 忽略 EPIPE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55768090/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com