gunicorn配置

workers = 2
# workers = multiprocessing.cpu_count()
# worker_class = "geventwebsocket.gunicorn.workers.GeventWebSocketWorker"  # 协程,同步,websocket
# worker_class = "gevent"                                                  # 协程,同步,无websocket,低开销
worker_class = "uvicorn.workers.UvicornWorker"                             # 优先
loglevel = "info"
timeout = 30000

preload_app = True          # Master进程提前加载应用,然后fork给Workers,不可动态加载
bind = "0.0.0.0:8301"
proc_name = "gun_uc"        # 主进程名称,ps,top
pidfile = "./logs/gun.pid"  # 默认无

errorlog = "./logs/gun_error.log"    # 默认标准输出
accesslog = "./logs/gun_access.log"  # 默认无访问日志
threads = 10                         # 需worker_class = "gthread"

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注