Menu

Hedging when the hedges compete for the same service
📰

Hedging when the hedges compete for the same service

DEV Community: microservices·Fabián Guamán Flores·4 days ago
#V6gLY5K2
#devtomicroservices#devto#dev#hedge#budget
Reading 0:00
15s threshold

The question

After the release candidate was announced, a reader asked how hedging behaves under tail latency when the second call contends for the same downstream. It is the right question. A hedge sends a second request when the first one is slow. If the first one is slow because of bad luck (a GC pause, a cold cache, one slow disk), the second one usually wins and the tail shrinks. If the first one is slow because the service is busy, the second request makes it busier, for every caller.

The hedge page already says not to hedge a saturated dependency, and that the hedge budget "limits the damage, it does not undo it". This article puts numbers on that sentence.

How it was simulated

The question is about queues, not about the cost of the policy, so this is not a JMH benchmark. JMH measures what code costs in a closed loop, where a slow service slows the callers down too and hides the collapse this article is about.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.