| # 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" |