架构图如上所示
没有使用 Nginx,(不想使用 Nginx)
前端有 count 操作,这个 count 操作非常的耗时,短则几分钟,长则无法估量gunicorn.conf.py
bind = "0.0.0.0:63001"
workers = 2
threads = 64
我需要防止可用的连接资源被耗尽
我查了一下 Gunicorn 的 conf doc
发现和 timeout 相关的只有:
但是这两个参数好像都是说进程不干活,restart 进程的,和我的需求不是一回事
所以。Gunicorn 无法设置一个 request 的 timeout 吗?
比如 10 秒无法 response,就 reponse 一个 504
如果 Gunicorn 无法实现的话?Django 的 ORM 可以设置 timeout 吗?
在 Gunicorn 前再加一个 Nginx,超时在 Nginx 上配置即可。