Interview Prep/SRE & Reliability/Release Engineering & Reliability Patterns

Why should every network call have a timeout, and how do you choose the value?

BeginnerConceptRelease Engineering & Reliability Patterns
Answer

Without a timeout, a hung dependency holds threads, connections and memory until the caller runs out and fails too, spreading the outage. Pick timeouts from the dependency's measured latency (a bit above its p99.9) and the caller's own budget: the total of downstream timeouts plus retries must fit inside the caller's timeout. Set connect timeouts short (hundreds of milliseconds) and request timeouts based on the operation. Never rely on library defaults; many are infinite or minutes long.

All SRE & Reliability questions

More on Release Engineering & Reliability Patterns