Initial commit
This commit is contained in:
25
xuexiao/gunicorn_config.py
Normal file
25
xuexiao/gunicorn_config.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import multiprocessing
|
||||
|
||||
# 绑定地址和端口
|
||||
bind = "0.0.0.0:8000"
|
||||
|
||||
# 工作进程数(Python 3.11 性能更好,CPU核数*2即可)
|
||||
workers = multiprocessing.cpu_count() * 2
|
||||
|
||||
# 使用异步 worker 提升性能
|
||||
worker_class = "gevent"
|
||||
|
||||
# 超时时间
|
||||
timeout = 120
|
||||
keepalive = 5
|
||||
|
||||
# 日志配置
|
||||
accesslog = "/app/logs/gunicorn_access.log"
|
||||
errorlog = "/app/logs/gunicorn_error.log"
|
||||
loglevel = "info"
|
||||
|
||||
# 进程名称
|
||||
proc_name = "flask_app"
|
||||
|
||||
# 生产环境关闭自动重载c
|
||||
reload = False
|
||||
Reference in New Issue
Block a user