Skip to content

.tip

· one of the small things

The caller's timeout must be shorter than the callee's

Say your service times out at 30 seconds and the API it calls does too. The upstream gives up first, you spend the last second doing nothing useful, and then you return an error to a client that has already stopped waiting.

client → gateway 10s → service 8s → database 5s

Make each hop shorter than the one before it. That way a timeout fails at the layer that can still do something about it.

httpreliability