# Hedged requests

> Send a second copy of a slow call and keep the first answer, so a rare slow server stops setting your tail latency.

A hedged request cuts the tail by racing a second copy of a call that is taking too long.

## Use it when

- The p99 is far above the p50 because a few calls land on a slow replica or a busy moment.
- The call is read-only or safe to repeat.
- The callee has spare capacity for a little extra traffic.

## How it works

The caller sends a request and starts a clock. If no answer arrives by about the p95 latency, it sends the same request to another replica and uses whichever answer comes first. A call is slow only when both copies are slow, so the rare slow answer must happen twice. Google described this in "The Tail at Scale". Hedging only after the p95 means about 5% of calls get a second copy, not all of them.

## What it costs

The callee sees extra load, and a hedge at the wrong threshold doubles it. A hedge on a write can run it twice, so use it for reads or idempotent calls. It also hides a slow replica instead of fixing it, and during real overload the extra copies make things worse. Cancel the losing copy when the winner returns.

## In Quorum



**Hedge** is a setting on a Link, so each Link chooses for itself. It sends a second copy after a slow first one and keeps the faster answer: the tail drops, and the Database sees a small share of extra calls. [Hedged requests](https://wiki.playquorum.dev/research/hedged-requests.md) unlocks it and needs [Tracing](https://wiki.playquorum.dev/research/tracing.md). The glossary defines [hedged request](https://wiki.playquorum.dev/glossary/hedged-request.md) and [tail at scale](https://wiki.playquorum.dev/glossary/tail-at-scale.md).

Source: https://wiki.playquorum.dev/patterns/hedged-requests
