Files
Django/gunicorn.conf.py

33 lines
841 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 生产配置systemd 与 1Panel 共用此文件,勿再手写冲突参数)
# 安装后: systemctl restart gunicorn-dianjing.service
bind = "127.0.0.1:8001"
# 必须用 gthreadsync 模式下 4 worker 同时只能处理 4 个请求,远程 MySQL 一慢就全站卡死
workers = 6
threads = 4
worker_class = "gthread"
timeout = 120
graceful_timeout = 30
keepalive = 2
max_requests = 2000
max_requests_jitter = 100
# 禁止输出到 stdout/stderr曾灌满 journal 导致整机卡)
accesslog = None
errorlog = "/tmp/gunicorn-error.log"
loglevel = "warning"
# gthread + MySQL 连接池preload 易在 fork 后出连接问题
preload_app = False
proc_name = "a_long_dianjing_gunicorn"
worker_tmp_dir = "/dev/shm"
daemon = False
limit_request_line = 4094
limit_request_fields = 100
limit_request_field_size = 8190