File size: 715 Bytes
b440e00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os

# General recommendation: (2 * number_of_cores) + 1
# For your 2vCPU machine, 5 is a good starting point.
workers = int(os.environ.get('GUNICORN_PROCESSES', '5'))

# Use the Uvicorn worker class for asyncio compatibility
worker_class = "uvicorn.workers.UvicornWorker"

# The address and port to bind to
bind = "0.0.0.0:8000"

# Set log levels
loglevel = "info"
accesslog = "-"  # Log access to stdout
errorlog = "-"   # Log errors to stderr

# --- CRUCIAL CHANGE ---
# Set worker timeout to 0 to disable it completely.
# This prevents Gunicorn from killing workers during long-running streams.
timeout = 0

# Timeout for gracefully restarting a worker (still useful for deployments)
graceful_timeout = 60