Unblocking the Loop: Mastering Python's I/O Loop Monitoring
summary
Production asyncio services suffer repeated pod restarts after the event loop blocks for seconds at a time, once showing a 7s ping and daily restarts, traced to forgotten awaits and CPU heavy sync work inside async handlers. The investigation uses httpx async clients, async DB calls, Kubernetes and AWS, and yields a small Python package that installs via set_event_loop_policy and reports per coroutine name duration count and loop lag. The open source loop monitor proves it catches blockers and stops the invisible latency cascade.
AI-written summary · about
chapters (10)
- 0:00Introduction and speaker intro
- 1:34Understanding Python's event loop
- 4:03How asyncio works in practice
- 8:43Challenges with asyncio loops
- 9:50Real-world production issues
- 12:39Debugging blocked event loops
- 15:10Searching for solutions
- 16:14Designing the monitoring tool
- 17:42Introducing the loop monitor
- 18:46Demo and results
related talks
40mAdvanced asyncio: Solving Real-world Production Problems
32mDemystifying AsyncIO: Building Your Own Event Loop in Python
28mIf an asyncio Task fails in the woods and nobody is around to see it, does i....
23mPractical usage of asyncio
32mAdvanced asyncio: Solving Real-World Production Problems
32mEnhancing AsyncIO for Complex Applications
56mLeveraging Async and Await in Modern Python
27m"Python’s tale of concurrency"
