【问题标题】:App with long startup and gunicorn timeout具有长时间启动和 gunicorn 超时的应用程序
【发布时间】:2020-10-13 00:39:03
【问题描述】:

我有一个烧瓶应用程序需要一分钟才能启动,但随后应该会快速响应。目前我正在使用gunicorn -t 90(如Running Gunicorn Flask app in Docker [CRITICAL] WORKER TIMEOUT when starting up 中所述)来避免应用程序被杀死,但是它也会影响初始化后的超时。有没有办法让这个更细粒度?某种方法可以放松超时设置,直到应用程序发出初始化完成的信号?还是在应用导入完成后收紧?

【问题讨论】:

    标签: python flask timeout gunicorn


    【解决方案1】:

    您可以尝试在gunicorn_conf.py 中设置preload_app=True 或将初始化移动到on_startup

    【讨论】:

      猜你喜欢
      • 2012-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-29
      • 1970-01-01
      • 1970-01-01
      • 2014-11-02
      • 1970-01-01
      相关资源
      最近更新 更多