我在Digital Ocean上部署了一个烧瓶应用程序,当我进行大型请求时,日志错误为:
[1] [CRITICAL] WORKER TIMEOUT (pid:48)
我试图以这种方式增加Gunicorn的超时,但错误仍然存在:
#gunicorn_config.py
bind = "0.0.0.0:5000"
workers = 2
timeout = 600
#Procfile
web: gunicorn app:app --timeout 600
#env/Lib/site packages/gunicorn/coonfig.py
class Timeout(Setting):
name = "timeout"
section = "Worker Processes"
cli = ["-t", "--timeout"]
meta = "INT"
validator = validate_pos_int
type = int
default = 600
desc = """
知道我做错了什么吗?谢谢
尝试指向您的配置文件
gunicorn -c gunicorn_config.py --bind 0.0.0.0:5000 wsgi:app
注意,要使该语句工作,您还需要在具有以下的同一目录中使用wsgi.py
from myproject import app
if __name__ == "__main__":
app.run()
干杯!