Granian serves ASGI, RSGI, and WSGI applications over HTTP/1 and HTTP/2 with websockets and static files. Install via pip and run the granian CLI.
Overview
Granian is a Python-facing HTTP server implemented in Rust on Hyper and Tokio. It targets teams that want one dependency instead of stacking Gunicorn, uvicorn, and separate HTTP stacks.
Interfaces cover ASGI/3, RSGI, and WSGI applications with HTTPS, mutual TLS, websockets, static file serving, and ASGI pathsend support. Optional extras add dotenv loading, custom process names, and reload-on-change.
Documentation discusses worker counts, threading, backlog behavior on Linux, and when Granian fits high-throughput or HTTP/2-heavy workloads versus pure-Python servers.
Quick start installs the wheel with pip and launches apps through the granian command specifying interface type and module path.
Key features
- ASGI WSGI RSGI support
- HTTP/1 and HTTP/2
- HTTPS and mTLS
- Websocket handling
- Static file serving
- Optional hot reload
- Rust Hyper Tokio core
- CLI process controls
Use cases
- High-throughput Python APIs
- HTTP/2 ASGI deployments
- Single-binary app serving
- Websocket-heavy services