Files
zjpb.net/gunicorn_config.py

45 lines
675 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Gunicorn配置文件
import os
# 绑定地址和端口
bind = "0.0.0.0:5000"
# 工作进程数 (推荐: CPU核心数 * 2 + 1)
workers = 4
# 工作线程数
threads = 2
# 工作模式
worker_class = "sync"
# 超时时间(秒)
timeout = 120
# 访问日志
accesslog = "logs/access.log"
# 错误日志
errorlog = "logs/error.log"
# 日志级别
loglevel = "info"
# 进程名称
proc_name = "zjpb_app"
# 守护进程模式设置为False由systemd或supervisor管理
daemon = False
# PID文件
pidfile = "logs/gunicorn.pid"
# 预加载应用(提高性能)
preload_app = True
# 优雅重启超时
graceful_timeout = 30
# 保持连接
keepalive = 5