Posts Tagged: uvicorn
-
FastAPI 0.115 to 0.120: New Lifespan Events Replace on_startup and on_shutdown
FastAPI 0.115-0.120 migration: Replace deprecated @app.on_event('startup'/'shutdown') with lifespan=asynccontextmanager(app). DB pools, ML models, uvicorn reload safe. Code before/after, pytest verify. Targets 'fastapi lifespan migration', 'fastapi startup shutdown deprecated', 'fastapi 0.115 lifespan events'.
-
FastAPI Framework: Python ASGI Microframework Tutorial
FastAPI tutorial: installation, hello world app, Pydantic models, databases, dependencies, testing, deployment. Benchmarks vs Flask and Django.
-
Scaling FastAPI WebSockets to 10,000 Concurrent Connections with Uvicorn
Configure Uvicorn to handle up to 10,000 concurrent WebSocket connections in FastAPI applications. Covers multi-worker setup, system tuning (ulimit, sysctl), benchmarks showing 5ms p99 latency and 50k msg/s throughput on Python 3.13, verified with websocket-bench. Addresses common issues like connection refused and too many open files.
-
Flask vs FastAPI for Real-Time WebSocket Applications: Latency Benchmarks
Flask vs FastAPI WebSocket benchmarks on Python 3.13 M2 Mac: compare latency and throughput for realtime apps. Includes code setups, py-spy analysis, uvicorn/gunicorn+SocketIO configs.
-
How to Reduce FastAPI JSON Response Time by 40% Using orjson Instead of stdlib json
FastAPI orjson integration: 40% faster JSON responses (28ms → 17ms p99 avg). Custom ORJSONResponse class, benchmarks uvicorn Python 3.13, 10k req/s load. Pydantic v2 auto-detects orjson. Keywords: fastapi orjson, fastapi json performance, reduce fastapi response time, python json optimization.
-
Python 3.13 Performance Gains: Benchmarking FastAPI Endpoints Before and After Upgrade
We benchmark a minimal FastAPI application on Python 3.12 and 3.13 to measure real-world performance differences in RPS and latency for JSON GET and POST endpoints using Locust and uvicorn workers.