Careeroza
Production Server
Uvicorn and Workers
| Command | Use |
|---|---|
fastapi dev main.py | development (auto-reload) |
fastapi run main.py --workers 4 | production on a VM |
uvicorn main:app --host 0.0.0.0 --port 8000 | one process per container (Kubernetes, Cloud Run) |
In containers, run one Uvicorn process per container and let the platform scale the number of containers. On a single VM, use several workers (about one per CPU core).