Building a NoGIL Load Balancer in 30 minutes
summary
Live codes a threaded Fibonacci server, then swaps to a free‑threaded CPython build and a simple proxy load balancer, with concrete stress tests showing 24k–34k req/s on short requests and throughput collapse when a single long request holds the CPU. Demonstrates that removing the GIL yields better scaling for CPU‑bound work, but not for IO‑dominated fast requests (no GIL scales better when CPU‑bound). Finds an unexpected mutex inside random() that throttles concurrency (random() lock caused bottleneck).
AI-written summary · about
chapters (8)
- 0:00Introduction
- 7:36Stress Test
- 11:58NoGIL Test
- 14:20Load Balancer
- 16:43Test
- 17:35Random
- 18:25Load Connection
- 28:30Conclusion
related talks
29mGoodbye GIL: Exploring the Free-threaded mode in Python
29mPython's Infamous GIL
38mDemystifying the GIL
29mTrying No GIL on Scientific Programming
30mFree threaded Python past, present and future
01h 34mPython for Distributed Systems
24mEngage the Hyper-Python
31mGetting Around the GIL: Parallelizing Python for Better Performance
