Serving Python web apps · Uvicorn (ASGI) + Gunicorn (WSGI/process manager) · verified against Uvicorn 0.52 / Gunicorn 26 (2026)

Python Web Servers cheat sheet

Uvicorn is the fast ASGI server for async apps (FastAPI, Starlette, Django-async); Gunicorn is the battle-tested WSGI server + process manager for sync apps (Flask, Django). The classic production pattern runs Gunicorn as the process master with Uvicorn workers for ASGI apps — robust process supervision plus async speed. This grouped sheet covers both, the combo, tuning, and deployment, with pointers to Hypercorn & Granian. Targets Uvicorn 0.52.x + Gunicorn 26.x, Python 3.10+.

Uvicorn (ASGI) Gunicorn (WSGI) the combo tuning & lifecycle deploy & alternatives gotcha most common

Verified 2026-08-31 against uvicorn.dev (Uvicorn 0.52.3, 2026-08-13) and gunicorn.org (Gunicorn 26.2.0, 2026-08-24; Python 3.10–3.13). App path syntax is module:app_variable for both. Gunicorn is UNIX-only (no Windows).

Outline

ASGI app? Uvicorn. WSGI app? Gunicorn. Production ASGI? Gunicorn managing Uvicorn workers. Then tune workers/timeouts and deploy behind a reverse proxy.

Uvicorn (ASGI)

  1. 1Install & run
  2. 2CLI options
  3. 3Programmatic & reload

Gunicorn (WSGI)

  1. 4Install & run
  2. 5Workers & worker classes
  3. 6Config file

The combo

  1. 7Gunicorn + Uvicorn workers
  2. 8Which multi-worker?

Tuning & lifecycle

  1. 9Timeouts, reload & signals
  2. 10Binding, sockets & proxies

Deploy & alternatives

  1. 11systemd, Docker & nginx
  2. 12Alternatives & choosing

Uvicorn (ASGI)

The go-to server for async frameworks. One command in dev; multi-worker in prod.

1Install & runASGI
2CLI optionsthe useful flags
3Programmatic & reloadrun from code

Gunicorn (WSGI)

The mature process manager for sync apps — and the master for ASGI workers.

4Install & runWSGI · UNIX
5Workers & worker classesconcurrency model
6Config filegunicorn.conf.py

The Production Combo

Gunicorn's process supervision + Uvicorn's async workers = the standard ASGI deploy.

7Gunicorn + Uvicorn workersFastAPI in prod
8Which multi-worker?gunicorn vs uvicorn --workers

Tuning & Lifecycle

Timeouts, zero-downtime reloads, signals, and running behind a proxy.

9Timeouts, reload & signalsoperate it
10Binding, sockets & proxiesthe network edge

Deploy & Alternatives

Supervise it, containerize it, and know the other servers in the space.

11systemd, Docker & nginxrun it for real
12Alternatives & choosingthe landscape

Worth memorizing

ASGI vs WSGIUvicorn=async, Gunicorn=sync master
module:appapp path syntax for both
uvicorn[standard]uvloop + httptools + reload extras
uvicorn --host 0.0.0.0 --workers Nmulti-worker, no gunicorn needed
--reloaddev only; needs import-string app
gunicorn -w 4 -b :8000workers = 2*CPU+1 rule of thumb
-k uvicorn_worker.UvicornWorkerthe ASGI-in-prod combo (new package!)
gunicorn.conf.pyPython config, auto-loaded from CWD
--max-requestsrecycle workers to bound leaks
--timeout / kill -HUPworker timeout / graceful reload
-b unix:/run/app.sock+ --proxy-headers behind nginx
gunicorn = UNIX onlyWindows -> uvicorn / waitress