HandbookXIII the AqueductTimeouts and back-pressure
XIIIthe Aqueduct, Scale itTimeouts and back-pressure
In plain words
Timeouts cap how long you wait for another service, and back-pressure means refusing or slowing new work when you're already full, so one slow part can't drag the whole system down with it.
Where you see it
Harbor's tax provider starts answering in 30 seconds instead of 200 ms. Checkout calls it with no timeout, so requests pile up, the servers run out of connections, and the dashboard and sign-in fail too, though neither uses tax at all.
What goes wrong
- Relying on the default timeout
Many HTTP clients and database drivers wait minutes by default, and some wait forever. Set an explicit timeout on every outbound call, shorter than the request that's waiting on it.
- Retries that multiply the load
When a service slows down, three layers each retrying three times turn one request into 27. Retry at one layer only, with exponential backoff, jitter and a cap, and stop when a circuit breaker opens.
- Queues with no limit
A queue with no maximum hides overload until memory runs out or jobs are hours old. Set a limit, and reject new work with a clear 503 and Retry-After when you reach it.
What to tell your agent
Quick check
Sign in to earn +10 XP for itHarbor's tax provider slows to 30-second responses, and soon sign-in fails too, though sign-in never calls the tax provider. Why?