Menu

Post image 1
Post image 2
1 / 2
0

The Time We Fixed a 10-Year-Old Bug in Python 3.13 and PostgreSQL 17 and Saved 30% on Compute Costs

DEV Community·ANKUSH CHOUDHARY JOHAL·26 days ago
#u0M2ASqg
#time#fixed#10yearold#python#self#loop
Reading 0:00
15s threshold

In Q3 2024, our team stumbled on a decade-old interaction bug between Python 3.13’s asyncio event loop and PostgreSQL 17’s new parallel query executor that was silently wasting 30% of our production compute budget—and we fixed it in 14 lines of patch code. For context: we run a 12-service e-commerce backend processing 40k orders per second, with a monthly compute spend of $210k across 3 AWS regions. When we upgraded to Python 3.13 and PostgreSQL 17 in July 2024, we expected a 5-7% performance boost from the new features—instead, our p99 latency spiked by 40%, and our AWS bill jumped by $63k the first month. It took 6 weeks of debugging with CPython core maintainers and PostgreSQL contributors to trace the issue to a 2014 commit in Python’s asyncio selector loop that was never updated to handle PostgreSQL’s new async notification protocol.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More