Archives
Every essay, tool teardown, and build note, newest first.
-

SIGTERM Graceful Shutdown: Why In-Flight Requests Die on Deploy
A default SIGTERM ends the process in 0.90 ms and answers none of the 12 requests in flight. A drain that counts requests instead of connections served all 12 and exited in 435.6 ms;…
Read the article → -

asyncio Connect Stalls at 1 s, 3 s and 7 s: the Listen Backlog Is Full
An asyncio accept queue holds 2 connections at listen(1); past that, connects return at 1 s, 3 s and 7 s, while a blocked loop adds 1,004 ms to the reply.
Read the article → -

Python subprocess Deadlocks: the 64 KiB Pipe, Zombies, Orphan Process Groups and asyncio Descriptor Leaks – a Measured Runbook
A pipe holds 65,536 bytes, so a child that writes more stops dead: reading it in the wrong order delivered 131,072 bytes, then waited forever.
Read the article → -

pytest-asyncio in Production CI: Cross-Loop Futures, Leaked Tasks and Flaky Async Tests – a Measured Isolation Runbook
Measured pytest-asyncio isolation: cross-loop futures fail 20/20 runs, leaked tasks stay invisible, and a small guard names the culprit.
Read the article → -

httpx AsyncClient in Production: PoolTimeout, RemoteProtocolError, Keep-Alive Exhaustion & Retry Storm Defense with tenacity
Measured httpx failure modes: PoolTimeout is queue arithmetic, keep-alive races raise RemoteProtocolError, and jitter plus a breaker stop retry storms.
Read the article → -

SQLAlchemy 2.0 Async in Production: Resolving MissingGreenlet, Connection Pool Leaks, N+1 Queries & Transaction Deadlocks
A measured runbook for SQLAlchemy 2.0 async: MissingGreenlet on expired attributes, N+1 behind run_sync, leaked pool slots, and which SQLSTATEs to retry.
Read the article → -

FastAPI in Production: Gunicorn + UvicornWorker Deadlocks, Event Loop Starvation, Connection Pool Exhaustion & Graceful Shutdown
Measured FastAPI on Gunicorn and UvicornWorker: starved heartbeats, blocked loops, real thread deadlines, pool math and shutdown order.
Read the article → -

Fixing Memory Leaks in Production Python: How to Profile, Detect, and Resolve OOM Errors in Celery & Asyncio Workers
Measured on Python 3.12.16: what a leak costs in Celery and asyncio workers, the five patterns that cause it, and the guard module that keeps it fixed.
Read the article → -

Python Asyncio Web Scraping & API Automation: How to Process 10,000 Requests in 60 Seconds Safely
Measured on Python 3.12.16: Little’s law for sizing, semaphores, connector and token-bucket limits, jittered retries, and 10,000 requests in 61.9 seconds.
Read the article →