AlgoViz

Timeouts

easy 30 min

A timeout is the longest time you are willing to wait for something.

Where it shows up

The same pattern appears across everyday software.

  • TCP

    Every TCP connection computes its own retransmission limit from measured round trips, and doubles it after each timeout.

  • gRPC deadlines

    A client sets a deadline, the server sees it and cancels the call when it passes. Server code must check and stop its own work.

  • Go programs

    The context that enters a request handler carries its deadline into database and HTTP calls, so cancelling it stops them all.

  • Databases

    `statement_timeout` in PostgreSQL stops a query on the server. A limit only in the client would leave the query running.

  • Load balancers and proxies

    They have an idle or response limit of their own. If it is shorter than your service's limit, users see 504 while your service works on.

  • AWS Builders' Library

    Describes choosing an acceptable rate of false timeouts, such as 0.1%, and using the matching latency percentile as the limit.