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

Pydantic v2 in Production: Schema Compilation Cost, ValidationError Floods and Serialization Bottlenecks – a Measured Runbook
One dynamic model per request cost 358.046 us, 1,000 errors became 218.7 KiB of log text, and a tagged union was 2.94x faster.
Read the article → -

ProcessPoolExecutor in Production: BrokenProcessPool, Hung Workers and Fork Deadlocks – a Measured Runbook for Python 3.12
Measured: one dead ProcessPoolExecutor worker broke 8 of 8 queued futures, a hung worker blocked shutdown forever, and a fork child hung on a lock.
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 → -

Production Celery Architecture in Python & FastAPI: Resolving Task Starvation, Worker Deadlocks, Memory Bloat & Duplicate Execution
A Celery 5.4 configuration matrix for FastAPI on Python 3.12: prefetch starvation, worker recycling, late acknowledgement and idempotent locks.
Read the article → -

Kubernetes Pod Resource Optimization & OOMKilled Defense for Python & FastAPI: Requests vs Limits, cgroups v2 Accounting, glibc vs jemalloc RSS and Zero-Downtime Drain
Exit 137 is 128 + 9, and a freed 96 MiB burst kept 95.4 MiB resident on Python 3.12.16. Measured pod sizing, QoS classes, CPU limits and drain budgets.
Read the article → -

Docker Architecture & Process Simulation for Python FastAPI: Multi-Stage Builds, PID 1 Signals, Graceful Shutdowns and Zero-Downtime Rollouts
Docker runbook for Python 3.12 and FastAPI, measured at process level: PID 1 signal loss, shells that swallow SIGTERM, bytecode cache traps, drain timings.
Read the article → -

Redis Production Architecture in Python & FastAPI: Cache Stampede, Distributed Locks, Eviction & Connection Pools
Measured on Redis 7.0.15: a stampede of 64 readers turned one expired key into 321 queries, and a lease lock lost its key in 1 of 100 evictions.
Read the article →