Failure Detectors Explained: How Systems Tell Dead from Slow

Failure detectors explained in plain terms start with a question that has no perfect answer: how do you know a machine is dead, rather than merely slow? The central question is how a distributed system can act on a failure it cannot prove, and the answer is that it does not prove anything at all, it suspects, and it acts on suspicion while keeping a way back if the suspicion was wrong.

Every distributed system needs to know when a member has failed. A database must stop waiting for a dead replica, a cluster must elect a new leader when the old one goes quiet, and a load balancer must stop sending traffic to a server that will never answer. The failure detector is the component that makes those calls.

This article explains how failure detectors work, the trade between speed and accuracy, and the suspicion-based design that modern systems favour.

Key takeaways

  • A failure detector reports which nodes it suspects have failed.
  • It can never be certain, because a slow node looks exactly like a dead one.
  • Fast detection risks false alarms; cautious detection risks slow recovery.
  • Heartbeats are the usual signal, and missing heartbeats raise suspicion.
  • Phi-accrual detectors express suspicion as a score that grows over time.

What a failure detector is

A failure detector is a service that watches the members of a distributed system and maintains a list of those it suspects have crashed. Other components consult that list when they need to decide: a consensus protocol asks whether the leader is suspected before starting an election, and a replication layer asks whether a replica is suspected before writing around it.

The detector itself is deliberately simple. It does not fix failures, it does not move data, and it does not decide what to do about a suspected node. It only answers one question, as best it can: is this node still alive? Separating that question from the actions that follow keeps the system modular and the detector easy to reason about.

The idea was formalised by Chandra and Toueg in 1996, who showed that consensus is impossible without some form of failure detection, and that the properties a detector needs depend on the guarantees the system wants. Their work turned an engineering habit, watching for heartbeats, into a theory with precise definitions.

Heartbeats and timeouts

The most common design is the heartbeat. Each node sends a short message to its peers at regular intervals, saying it is alive, and each node watches for the heartbeats of the others. If a heartbeat does not arrive within a timeout, the watcher suspects the sender has failed.

The timeout is the whole design in one number, and choosing it is a genuine trade. A short timeout detects failures quickly, but it also suspects healthy nodes that are merely slow, because a busy machine or a congested network can delay a heartbeat by seconds. A long timeout avoids false alarms, but it leaves the system waiting for a dead node long after it stopped responding.

False suspicion is not a minor inconvenience. Suspecting a healthy leader triggers an election, and an election interrupts service, so a detector that cries wolf too often causes more damage than the failures it is meant to catch. The art of failure detection is tuning the timeout so that real failures are caught quickly and slow nodes are forgiven.

Why certainty is impossible

The deep reason failure detection is hard is that a distributed system cannot distinguish a crashed node from a slow one. A node that has crashed sends nothing, and a node that is stuck in a long garbage collection, or cut off by a network partition, also sends nothing. From the outside, the two look identical.

This is the same impossibility that underlies the FLP result, which proved that consensus cannot be guaranteed in a fully asynchronous system where messages may be delayed without bound. If messages can be delayed forever, no timeout can ever prove a node is dead, because the heartbeat might still be on its way.

Real systems escape the impossibility by assuming partial synchrony, which means that messages are usually delivered within some bound, even if the bound is unknown. Under that assumption, a long silence is strong evidence of failure, even though it is never proof, and the system acts on the evidence while keeping a path back if it was wrong.

The way back matters. A node that was wrongly suspected must be able to rejoin, and the system must be able to reconcile whatever happened while it was thought dead. A leader that was replaced must step down when it returns, and a replica that was written around must catch up, which is why suspicion is always provisional rather than final.

Phi-accrual failure detectors

The modern answer to the timeout problem is the phi-accrual detector, designed by Hayashibara and colleagues and used in Akka, Cassandra, and other systems. Instead of a fixed timeout, it keeps a history of heartbeat arrival times and computes a suspicion level, called phi, that grows as the silence lengthens.

The phi value is a number that expresses how surprising the silence is, given the node’s past behaviour. If heartbeats normally arrive every second and none has arrived for three seconds, phi is high, because such a gap is unlikely for a healthy node. If heartbeats are normally irregular, the same three-second gap produces a lower phi, because the detector has learned to expect variation.

The application sets a threshold, and when phi crosses it, the node is suspected. The threshold is the tuning knob: a low threshold detects failures fast but suspects more healthy nodes, while a high threshold is cautious but slow. Because phi adapts to each node’s history, the same threshold works for a fast node on a quiet network and a slow node on a busy one, which a fixed timeout cannot do.

The design also degrades gracefully. As the network gets worse, phi rises more slowly, because the detector has learned that delays are normal, so it suspects less aggressively exactly when false suspicion would hurt most. Our guide to the gossip protocol explains how suspicion spreads between nodes once one of them raises it.

A dark hospital corridor with a glowing heart monitor line running along the wall, one flat segment glowing red among the steady peaks
A dark hospital corridor with a glowing heart monitor line running along the wall, one flat segment glowing red among the steady peaks, shows a failure detector at work: a missing heartbeat raises suspicion, but the patient may only be resting.

Failure detectors compared with other watchers

Failure detection overlaps with health checking and monitoring, but it is not the same as either. A health check asks a service whether it is ready, usually over HTTP, and a monitoring system collects metrics for humans to read, while a failure detector answers a machine that must decide right now whether to act.

The table below sets out the main contrasts.

Aspect Failure detector Health check Monitoring system
Who consumes it Other machines, automatically Load balancers, orchestrators Humans, on a dashboard
Speed Seconds, tuned for recovery Seconds, tuned for routing Minutes, tuned for humans
Output Suspected or not Healthy or not Metrics and alerts
False positives Costly, triggers elections Cheap, just reroutes traffic Cheap, just pages someone
Best for Consensus and replication Traffic routing Diagnosis and trends

The practical result is that a system needs all three, each tuned for its own consumer, and confusing one for another leads to detectors that are too slow or health checks that are too twitchy.

Where failure detectors are used

Consensus protocols depend on them most directly. Raft starts an election when a follower stops hearing from its leader, and the election timeout is, in effect, a failure detector with a randomised threshold. Our guide to Raft explains the election that follows, and our guide to leader election explains the wider problem of choosing a new coordinator.

Cassandra uses a phi-accrual detector to decide which nodes are up and which are down, and it feeds that decision into read and write routing, so that requests avoid suspected nodes without waiting for them to time out. The detector’s adaptivity is what lets a large cluster stay responsive as load varies through the day.

Akka Cluster, the toolkit for building distributed applications on the JVM, uses a phi-accrual detector as the basis of its membership service, and it exposes the suspicion level so that operators can tune the threshold for their own network conditions.

Orchestrators such as Kubernetes use a simpler form, a liveness probe that restarts a container that stops responding, which is failure detection with the action built in. The probe is cruder than a phi-accrual detector, but for restarting a container it is enough.

Strengths and limits

The greatest strength of a good failure detector is that it lets a system recover quickly without human help. A dead leader is replaced in seconds, a dead replica is written around, and the service keeps running through failures that would otherwise need an operator to notice and act.

It is also a strength that the detector is small and separate. It can be tuned, tested, and replaced without touching the rest of the system, and its output is a simple list that any component can read.

The limits are real, though. No detector can be both fast and always right, a wrongly suspected node can cause real damage if the system has no way back, and a detector tuned for one network can misbehave badly on another. The suspicion is always a guess, and the system must be built to survive its guesses being wrong.

Failure detectors checklist

  • Use heartbeats with a timeout, and tune the timeout for your network.
  • Prefer a phi-accrual detector when heartbeat intervals vary.
  • Set the suspicion threshold to balance speed against false alarms.
  • Always provide a way back for a wrongly suspected node.
  • Make a replaced leader step down cleanly when it returns.
  • Randomise election timeouts so nodes do not all suspect at once.
  • Monitor suspicion rates; a rising rate signals network trouble, not node trouble.
  • Test slow nodes, not just dead ones, because slow is the harder case.
  • Keep the detector separate from the actions that follow suspicion.

Frequently asked questions

What is a failure detector in simple terms?

It is a component that watches heartbeats from other nodes and reports which ones it suspects have failed, so the rest of the system can act.

Why can a failure detector never be certain?

Because a crashed node and a slow or partitioned node both stop sending messages, and from the outside they look exactly the same.

What is a phi-accrual failure detector?

It is a detector that computes a suspicion score from the history of heartbeat arrivals, raising suspicion gradually as the silence becomes more surprising.

What is the difference between a failure detector and a health check?

A failure detector feeds automatic decisions inside the system, while a health check tells a load balancer or orchestrator whether a service is ready for traffic.

What happens when a healthy node is wrongly suspected?

The system acts as if it failed, usually by electing a replacement, and the suspected node must rejoin and catch up when it returns.

How do I choose a suspicion threshold?

Start with the default, measure false suspicions and detection delay under real load, and adjust until false alarms are rare and real failures are caught quickly.

The bottom line

Failure detectors explained in one line are this: listen for the heartbeat, suspect the silence, and always leave a way back.

They are the sense of touch of a distributed system, imperfect and indispensable, and every act of automatic recovery starts with their quiet judgement.

This article is general information about how failure detectors work, not advice about configuring detection for a particular system.

Latest articles

Scroll to Top