Gunicorn
Python WSGI HTTP server. The standard production server for synchronous Python web applications (Flask, Django). Pre-fork model spawns worker processes to handle concurrent requests. Sits behind nginx/caddy as a reverse proxy. Simple configuration and high reliability make it the default choice for WSGI app deployment.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
No built-in TLS — always put nginx/caddy in front for SSL termination. Keep gunicorn behind firewall. Limit bind to internal interface, not 0.0.0.0 in production.
⚡ Reliability
Best When
Deploying synchronous Python WSGI apps (Flask, Django) in Linux/Docker production environments.
Avoid When
Building async Python apps (FastAPI, Starlette) — use uvicorn or hypercorn.
Use Cases
- • Deploy Flask or Django applications in production with gunicorn --workers 4 --bind 0.0.0.0:8000 myapp:app
- • Scale Python WSGI apps by increasing worker count: gunicorn -w $(2 * CPU + 1) for CPU-bound workloads
- • Use with gevent workers for I/O-bound apps: gunicorn --worker-class gevent --workers 1 -k gevent myapp:app
- • Containerize Python web apps: CMD ['gunicorn', '--bind', '0.0.0.0:8000', 'app:app'] in Dockerfile
- • Monitor worker health with gunicorn's built-in worker recycling and max-requests for memory leak mitigation
Not For
- • Async Python applications (FastAPI, Starlette) — use uvicorn or hypercorn for ASGI servers
- • Static file serving — always put nginx or CDN in front; gunicorn serves Python, not static files
- • Windows production deployment — gunicorn is Unix-only; use waitress on Windows
Interface
Authentication
WSGI server — auth handled by the web framework (Flask, Django), not gunicorn.
Pricing
MIT licensed open source server.
Agent Metadata
Known Gotchas
- ⚠ Worker count formula: 2 * CPU_CORES + 1 — too few workers causes queuing; too many causes context switching overhead
- ⚠ Sync workers (default) block during I/O — use gevent or eventlet worker class for I/O-bound apps to serve concurrent connections with one worker
- ⚠ gunicorn does NOT support ASGI — FastAPI/Starlette require uvicorn or hypercorn; gunicorn is WSGI-only
- ⚠ --max-requests and --max-requests-jitter should be set to mitigate memory leaks — workers are recycled after N requests
- ⚠ gunicorn sends SIGTERM to workers on shutdown — ensure your WSGI app handles graceful shutdown; connections may be dropped without proper signal handling
- ⚠ Worker timeout (default 30s) kills slow requests — long-running endpoints (file uploads, ML inference) need --timeout increase or async worker class
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Gunicorn.
Scores are editorial opinions as of 2026-03-06.