pzx-web-api/gunicorn.conf.py

23 lines
480 B
Python
Raw Normal View History

2023-08-10 12:27:18 +08:00
import multiprocessing
2023-10-24 18:08:45 +08:00
from gevent import monkey
monkey.patch_all()
2023-08-10 12:27:18 +08:00
bind = "0.0.0.0:5000"
2023-10-24 18:08:45 +08:00
worker_class = 'gevent'
2023-08-10 12:27:18 +08:00
# 设置最大并发量
daemon = False
debug = False
2023-10-24 18:38:23 +08:00
worker_connections = 1000
2023-08-10 12:27:18 +08:00
workers = multiprocessing.cpu_count() * 2 + 1
2023-10-24 18:30:52 +08:00
timeout = 120
2023-10-24 17:30:14 +08:00
2023-08-10 12:27:18 +08:00
# 指定每个工作者的线程数
2023-10-24 17:30:14 +08:00
# threads = 10
2023-08-10 12:27:18 +08:00
# pidfile = "/var/run/gunicorn.pid"
# accesslog = '/var/log/gunicorn_access.log'
# errorlog = '/var/log/gunicorn_error.log'
# 设置日志记录水平
loglevel = 'warning'