Sync vs. Async in Python: Tools, Benchmarks, and ASGI/WSGI Explained
summary
Claims concrete numbers and tools: synchronous WSGI test tops at ~100 users and ~1.6 RPS while ASGI tests hit thousands of concurrent clients with about 13,335 RPS, using uvicorn workers and uvloop event loop; benchmarks use Locust and highlight unexpected dips when any blocking library or heavy thread pools remain. Migration checklist is specific: make all code nonblocking, replace sync libraries or wrap them with asgiref shims, prefer native async drivers like asyncpg, and profile with py-spy or cProfile.
AI-written summary · about
chapters (13)
- 0:00Sync vs async in Python
- 2:56Sync vs async basics
- 6:52Event loops for async tasks
- 8:20WSGI and limitations
- 10:07ASGI: The async server gateway interface
- 12:36ASGI vs WSGI for I/O
- 15:25Migrating to async apps
- 18:59Benchmarking async performance
- 23:43Benchmark results analysis
- 25:49Async-compatible libraries
- 26:51Q&A: Thread pools
- 28:36Q&A: Docker memory issues
- 30:25Q&A: ChatGPT-like ASGI
related talks
26mSync or async? Feel the magic of coroutines and the event loop in Django
31mInside ASGI The Engine Behind Modern Python Web Frameworks
31mHey, Python-Web-Community! What's going on?
55mKeynote: The Natural State of Computers
18mFrom WSGI to ASGI - Django 3.0
23mµDjango, an Asynchronous Microservices Technique with Practical Examples
32mAsynchronous Django: Unlocking the Power of Async Programming
27m"Python’s tale of concurrency"
