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