Gunicorn
A fast, lightweight pre-fork WSGI and ASGI HTTP server for running Python web apps in production on UNIX.
Repository Health
Technical Analysis
Gunicorn (‘Green Unicorn’) is a Python WSGI and ASGI HTTP server for UNIX, built on a pre-fork worker model ported from Ruby’s Unicorn project. A master arbiter process supervises a pool of worker processes, restarting them when they die and reloading your application on signal, so a single command turns any WSGI or ASGI app into a resilient, production-ready service.
Broadly compatible with Django, Flask, Pyramid, FastAPI, Starlette, and any framework speaking the WSGI or ASGI protocol, Gunicorn is simply implemented, light on server resources, and fast. It ships several interchangeable worker types — synchronous, threaded, gevent, tornado, and ASGI — so you can match the concurrency model to your workload without changing application code.
What You Get
- A single
gunicorncommand that boots and supervises a pool of worker processes for any WSGI or ASGI application. - Interchangeable worker types — sync, gthread, gevent, tornado, and asgi — selectable via
--worker-classto fit your concurrency needs. - A master arbiter that keeps workers alive, restarts crashed processes, and supports zero-downtime reloads via SIGHUP and USR2.
- Extensive configuration through CLI flags, a Python config file, or environment variables, with server hooks for lifecycle events.
- Broad framework compatibility with Django, Flask, Pyramid, FastAPI, Starlette, and Paste-compatible deployments.
Common Use Cases
- Serving a Django or Flask application in production behind an nginx reverse proxy.
- Running FastAPI or Starlette ASGI apps with the dedicated ASGI worker class.
- Scaling request handling across CPU cores by tuning the number of pre-forked workers.
- Handling large numbers of concurrent, I/O-bound connections with gevent or threaded workers.
Under The Hood
Architecture Gunicorn implements a classic pre-fork model centered on the Arbiter class in gunicorn/arbiter.py, a master process that owns the listening sockets, spawns a configurable pool of workers, and keeps them alive by trapping UNIX signals — SIGHUP for reload, USR2 for binary upgrades, TTIN/TTOU to scale workers up and down. Your application is wrapped by a BaseApplication in gunicorn/app/base.py (with WSGIApplication as the CLI entry point), which loads your callable and hands it to workers; each worker in gunicorn/workers/ runs its own accept-and-serve loop, from the blocking SyncWorker in sync.py to threaded, gevent, tornado, and ASGI variants that subclass a shared base.
Tech Stack The project is pure Python (99% of the codebase), targets Python 3.10+, and is remarkably dependency-light — the only hard runtime requirement is packaging. Optional extras pull in gevent, tornado, or h2 for alternative worker classes and HTTP/2, and setproctitle for nicer process names. It builds with setuptools via pyproject.toml, exposes gunicorn and gunicornc console scripts, and integrates as a paste.server_runner entry point.
Code Quality The repository is mature and well-tested, with roughly 280 test modules under tests/ covering config parsing, HTTP handling, worker behavior, and the arbiter, driven by pytest and tox across multiple Python versions. A .pylintrc, structured config.py with a declarative KNOWN_SETTINGS registry, and clear module boundaries reflect a disciplined, long-maintained codebase. Every source file carries the MIT license header and the code favors explicit, readable control flow over cleverness.
API Design Developer experience is a core strength: a single gunicorn myapp:app command gets an app into production, and nearly every behavior is tunable through consistently named CLI flags, a Python config file, or environment variables. Settings are self-documenting via the config.py metadata, worker models swap in with a single --worker-class flag, and lifecycle hooks let operators inject custom logic, backed by a full documentation site at gunicorn.org and an examples/ directory of ready-to-run configurations.
Used by 33 apps in this directory
Langflow
AI Agents · AI Development
Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.
LibrePhotos
File Storage
Self-hosted photo library with AI-powered face recognition, semantic search, and automatic event albums — no cloud required.
LiteLLM
AI Development · Developer Tools
Open source AI gateway and Python SDK that gives you one OpenAI-compatible interface to call 100+ LLM providers, with built-in routing, cost tracking, guardrails, and virtual keys.
Mathesar
Databases
Spreadsheet-like interface for your PostgreSQL database — self-hosted, no SQL required, native Postgres access control.
MaxKB
AI Development · Knowledge Management
Build enterprise-grade AI agents with RAG, workflows & multi-modal support
MLflow
AI Development · Monitoring
The open source AI engineering platform for debugging, evaluating, monitoring, and optimizing production LLMs and agents at scale.
OpenReplay
Analytics
Self-hosted session replay and product analytics suite that lets you see exactly what users do on your web app — without sending data to third parties.
OSV.dev
Security
Google's open-source vulnerability database that maps CVEs to exact package versions across 50+ ecosystems with a public API and data dumps.
Phase Console
Devops · Security
End-to-end encrypted secrets management for engineering teams — from local dev to Kubernetes production.