Gunicorn Transition: add wsgi entrypoint and gunicorn config, bump version to 4.1.41

This commit is contained in:
2026-01-27 16:01:56 +09:00
parent def4e9eeb8
commit 526bd36c5a
6 changed files with 193 additions and 3 deletions

32
gunicorn_config.py Normal file
View File

@@ -0,0 +1,32 @@
# Gunicorn 최적화 설정 (Bottleproof v2)
import multiprocessing
import os
# 1. 네트워크 설정
bind = "0.0.0.0:9099"
backlog = 2048
# 2. 프로세스 관리
# GeventWebSocketWorker: SocketIO(WebSocket) 지원을 위해 필수
worker_class = "geventwebsocket.gunicorn.workers.GeventWebSocketWorker"
workers = 1 # SocketIO 세션 일관성을 위해 1개 권장 (Redis message queue 미사용 시)
worker_connections = 1000
timeout = 600
keepalive = 5
# 3. PID 관리 (정밀한 프로세스 제어를 위해 추가)
pidfile = "data/gunicorn.pid"
# 4. 로깅 설정
# data/log 폴더 자동 생성 보장
log_dir = "data/log"
if not os.path.exists(log_dir):
os.makedirs(log_dir, exist_ok=True)
accesslog = os.path.join(log_dir, "gunicorn_access.log")
errorlog = os.path.join(log_dir, "gunicorn_error.log")
loglevel = "info"
capture_output = True
# 5. 개발 편의성
reload = False # 운영 환경에서는 False