Gunicorn
ELI5 — The Vibe Check
Gunicorn (Green Unicorn) is the battle-tested Python HTTP server that's been running production apps since forever. It pre-forks multiple worker processes so your app can handle many requests at once. Pair it with Uvicorn workers for async frameworks and you've got a production powerhouse.
Real Talk
Gunicorn is a Python WSGI HTTP server that uses a pre-fork worker model to handle concurrent requests. It supports multiple worker types (sync, async, gevent, uvicorn), automatic worker process management, graceful restarts, and integrates with most Python web frameworks. It's the standard production server for Django and Flask.
Show Me The Code
# Django/Flask (sync workers)
gunicorn myapp.wsgi:application --workers 4
# FastAPI (async uvicorn workers)
gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker
When You'll Hear This
"Run Gunicorn with 2x CPU cores + 1 workers for optimal throughput." / "We use Gunicorn with uvicorn workers for our FastAPI production deployment."
Related Terms
Django
Django is the 'batteries included' Python web framework. It comes with an ORM, admin panel, auth system, form handling, and more — all built in.
Flask
Flask is the lightweight Python web framework — the 'just enough' option. It doesn't come with an ORM, admin panel, or auth system by default.
Uvicorn
Uvicorn is the lightning-fast ASGI server that runs your FastAPI and Starlette apps. Think of it as the engine under FastAPI's hood.
WSGI (Web Server Gateway Interface)
WSGI is the OG standard for Python web apps talking to web servers. It's been around since 2003 and it's how Django and Flask work under the hood.