feat: Initial commit with full deployment architecture and scripts
This commit is contained in:
commit
abb3efe114
96 files changed
+16789
No files matched your search
@@ -0,0 +1,40 @@
|
||||
|
||||
"""
|
||||
gunicorn_config.py
|
||||
Gunicorn 生产环境配置文件
|
||||
"""
|
||||
import multiprocessing
|
||||
import os
|
||||
|
||||
# 绑定地址
|
||||
bind = "127.0.0.1:5000"
|
||||
|
||||
# 工作模式
|
||||
# 使用 gevent 处理高并发和长连接 (SSE)
|
||||
worker_class = "gevent"
|
||||
|
||||
# 进程数
|
||||
# 公式: 2 * CPU核心数 + 1
|
||||
workers = multiprocessing.cpu_count() * 2 + 1
|
||||
|
||||
# 每个 Worker 的最大并发连接数
|
||||
worker_connections = 1000
|
||||
|
||||
# 超时设置 (秒)
|
||||
# SSE 流式响应通常需要较长的超时时间
|
||||
timeout = 120
|
||||
keepalive = 5
|
||||
|
||||
# 日志
|
||||
accesslog = "/var/log/hxops/access.log"
|
||||
errorlog = "/var/log/hxops/error.log"
|
||||
loglevel = "info"
|
||||
|
||||
# 守护进程模式 (由 Supervisor 管理时通常设为 False)
|
||||
daemon = False
|
||||
|
||||
# 进程名称
|
||||
proc_name = "hxops_backend"
|
||||
|
||||
# 预加载应用 (加快启动速度)
|
||||
preload_app = True
|
||||
Reference in new issue
Block a user