ifixkart-backend/gunicorn.conf.py

24 lines
637 B
Python

# Gunicorn configuration for iFixKart Unified Commerce Backend
import os
# Bind strictly to local loopback (Nginx reverse-proxies from port 80/443 on the same host)
bind = os.getenv("GUNICORN_BIND", "127.0.0.1:8010")
# Multi-worker process model: 4 workers across multi-core CPU
workers = int(os.getenv("GUNICORN_WORKERS", "4"))
worker_class = "uvicorn.workers.UvicornWorker"
# Timeouts
timeout = 120
graceful_timeout = 30
keepalive = 5
# Logging
accesslog = "-"
errorlog = "-"
loglevel = os.getenv("GUNICORN_LOGLEVEL", "info")
# Worker recycling to mitigate long-running memory creep
max_requests = 2000
max_requests_jitter = 400