# Gunicorn configuration file
import multiprocessing

# Bind to 0.0.0.0:8000
bind = "0.0.0.0:8000"

# Number of worker processes
# Recommended: 2-4 x $(NUM_CORES)
workers = multiprocessing.cpu_count() * 2 + 1

# Worker class
worker_class = "sync"

# Timeout for graceful workers restart
timeout = 120

# Restart workers after this many requests (helps with memory leaks)
max_requests = 1000
max_requests_jitter = 50

# Logging
accesslog = "-"
errorlog = "-"
loglevel = "info"

# Process name
proc_name = "[[ project_slug ]]"

# Server mechanics
preload_app = True
