python - Gunicorn + nginx - 忽略 EPIPE
问题描述
我有一个在谷歌计算上运行的 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;
--timeout 300
根据其他问题在 nginx 和 gunicorn 上的位置,但它没有帮助。
来自 gunicorn 的消息并没有真正帮助确定原因,我没有找到任何有关它的信息
一直试图解决这个问题,我会很感激任何想法。此外,这些请求中的每一个都需要大约 1-2 秒,并且 jmeter 显示出巨大的延迟,直到结果出现。
查看 gunicorn 的代码,这是一个与套接字有关的 errno.EPIPE 异常......
解决方案
推荐阅读
- angular - Angular 7:无法绑定到“指令”,因为它不是“元素”的已知属性
- asp.net-core-webapi - 无法将类型 dto 转换为类型 Ienumerable
- c++ - 如何使用两个 for 循环执行独特的随机播放
- javascript - 尝试将 html 表下载到具有下拉列表的一列的文本文件中
- ruby-on-rails - 如何缩小 Barby 条码以适合 PDF 页面大小
- oauth - 如何刷新 oauth2client.client 的 id_token?
- python - 尝试打开图像时,Tkinter“无法打开”pyimage1“:没有这样的文件或目录”错误
- postgresql - pgAdmin 找不到记录,而 SQLAlchemy 确实
- r - 试图找到一个向量的最小值
- excel - 如何遍历 Microsoft Project 任务的所有属性?