Timeouts and Deadlines in Production: Time Budgets, Propagation Across Services and Retries That Don't Multiply Load
A practical guide to making sure no request waits forever: why a per-socket timeout is not a total time limit, the difference between a timeout and a deadline, how to propagate a time budget across services (asyncio, httpx, FastAPI, Go and gRPC), how to split it across layers, how retries fit in without multiplying load, PostgreSQL and load balancer timeouts, common mistakes and a production checklist. With code in Python, Go, SQL and YAML. Expanded edition of October 10, 2026: Little's law applied to pools and timeouts with a script that computes when a pool saturates, structured cancellation with asyncio.timeout_at, TaskGroup and except*, fan-out with degradation of optional dependencies, hedged requests with a budget, HTTP client defaults and AbortSignal in Node, gRPC deadlines, codes and retry configuration, application servers (gunicorn, Go, Node) and which timeouts do not cancel the work, the full map of timers in nginx, Envoy, Istio and ALB, visibility timeouts and heartbeats in queues, PostgreSQL 17 transaction_timeout and budget-derived limits, admission control, a data-driven method for choosing the numbers, Toxiproxy tests, a worked case, retry budgets, traces with remaining time, FAQ and glossary.
Verificando acceso...