gunicorn.config.py 461 B

12345678910111213141516
  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. # 设置工作模式为协程
  14. worker_class = "gevent"
  15. bind = "0.0.0.0:5002"