gunicorn.config.py 655 B

1234567891011121314151617181920
  1. import os
  2. from multiprocessing import cpu_count
  3. # 日志配置
  4. # 本地日志存储路径
  5. log_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "logs")
  6. if not os.path.exists(log_path):
  7. os.makedirs(log_path)
  8. loglevel = "info"
  9. accesslog = os.path.join(log_path, 'access.log')
  10. errorlog = os.path.join(log_path, 'error.log')
  11. # workers = 5
  12. workers = 2 * cpu_count() + 1
  13. # 线程数 20240223 单线程改为多线程 解决服务挂掉问题 无效
  14. # threads = cpu_count()
  15. # 设置工作模式为协程
  16. worker_class = "gevent"
  17. bind = "0.0.0.0:5001"
  18. # 超时时间 默认30s 20240223 增加超时时间 解决服务挂掉问题
  19. timeout = 120