gunicorn.conf.py 833 B

1234567891011121314151617181920212223242526272829
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on 2023-04-24
  4. ---------
  5. @summary: gunicorn配置
  6. ---------
  7. @author: Dzr
  8. """
  9. import multiprocessing
  10. # 服务地址
  11. bind = '0.0.0.0:1405'
  12. # 代码更改时重新启动工作程序(适用于开发测试)
  13. reload = False
  14. # 日志输出级别
  15. loglevel = 'info'
  16. # 访问记录到标准输出
  17. accesslog = '-'
  18. # 访问记录格式
  19. access_log_format = '%({x-forwarded-for}i)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
  20. # 启动工作进程数量
  21. workers = multiprocessing.cpu_count() * 2 + 1
  22. # 工作模式
  23. worker_class = 'gevent'
  24. # 启动工作线程数量(当worker指定为gevent或者evenlet类型时,线程变成基于Greentlet的task(伪线程),这时候线程数量threads参数是无效的)
  25. # threads = multiprocessing.cpu_count() * 2
  26. # 转发白名单
  27. forwarded_allow_ips = '*'