File size: 919 Bytes
4ca437f
 
 
 
69dab88
4ca437f
 
 
69dab88
4ca437f
 
69dab88
4ca437f
 
 
 
 
 
69dab88
4ca437f
 
69dab88
4ca437f
 
 
 
69dab88
 
4ca437f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Gunicorn configuration file

# --- Server Socket ---
# Bind to all network interfaces on port 8000.
# This is required for containerized environments.
bind = "0.0.0.0:8000"

# --- Worker Processes ---
# Based on (2 * number_of_cpus) + 1 for your 2 CPU container.
workers = 5

# Use Uvicorn's worker class for async applications.
worker_class = "uvicorn.workers.UvicornWorker"

# The maximum number of simultaneous clients that a single worker can handle.
worker_connections = 1000

# The maximum number of requests a worker will process before restarting.
# This helps prevent memory leaks in long-running applications.
max_requests = 2048

# Add a random jitter to max_requests to prevent all workers from restarting at once.
max_requests_jitter = 512

# --- Logging ---
loglevel = "info"
accesslog = "-"  # Log to stdout
errorlog = "-"   # Log to stderr

# --- Process Naming ---
proc_name = "fastapi_reverse_proxy"