Files
backend/deploy/gunicorn.conf.py
2025-11-22 18:50:52 +08:00

45 lines
1.0 KiB
Python
Executable File
Raw Permalink 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.
# fmt: off
# 监听内网端口
bind = '0.0.0.0:8001'
# 工作目录
chdir = '/app/backend/'
# 并行工作进程数
workers = 1
# 监听队列
backlog = 512
# 超时时间
timeout = 120
# 设置守护进程,将进程交给 supervisor 管理;如果设置为 True 时supervisor 启动日志为:
# gave up: fastapi_server entered FATAL state, too many start retries too quickly
# 则需要将此改为: False
daemon = False
# 工作模式协程
worker_class = 'uvicorn.workers.UvicornWorker'
# 设置最大并发量
worker_connections = 2000
# 设置进程文件目录
pidfile = '/app/gunicorn.pid'
# 设置访问日志和错误信息日志路径
accesslog = '/var/log/app_server/gunicorn_access.log'
errorlog = '/var/log/app_server/gunicorn_error.log'
# 设置这个值为true 才会把打印信息记录到错误日志里
capture_output = True
# 设置日志记录水平
loglevel = 'debug'
# python程序
pythonpath = '/usr/local/lib/python3.10/site-packages'
# 启动 gunicorn -c gunicorn.conf.py main:app