【发布时间】:2019-10-01 13:33:07
【问题描述】:
我的问题是,在某些应用程序接收 body size large(xml) 并返回 xml large 的请求中,请求返回 502。这是随机发生的。
我认为它正在运行缓冲区溢出。
我的应用程序在 docker 中使用 wsgi 之类的 guinicorn 运行。我想将缓冲区大小的值更改为 64k。我怎么做?
我的 gunicorn 部署命令
python manage.py migrate && gunicorn backend.wsgi:application -b 0.0.0.0:8000 --workers 3 --log-level=info
我可能弄错了,我的基地在: Nginx uwsgi (104: Connection reset by peer) while reading response header from upstream
错误日志 nginx
38286 upstream prematurely closed connection while reading response header from upstream
【问题讨论】:
-
您的日志应该会告诉您 502 的来源以及确切原因。你在你的独角兽日志中看到了什么? nginx日志?甚至可能是 django 日志?
-
我也有同样的问题。如果使用 uwsgi,可以在 uswgi.ini 文件中指定缓冲区大小: [uwsgi] buffer-size = 32768 但是使用 gunicorn 时如何做到这一点?
-
您解决了这个问题吗?因为我有同样的问题。
标签: django docker nginx gunicorn wsgi