Try
↑ ↓ move↵ openesc close
In this lesson · topic 4 of 7
  1. 1. Silence is all you get
  2. 2. Heartbeats, timeouts and suspicion
  3. 3. Slide one detector along its curve
  4. 4. When a 600 ms pause beats the detector
  5. 5. Watching three hundred nodes without three hundred heartbeats each
  6. 6. Adding up a failover, and the storm a false alarm can start
  7. 7. Check the ten-second timeout

Topic 4

When a 600 ms pause beats the detector

5 min read

Each figure here is the mean of eight simulator seeds, four crash cycles apiece, and a test pins it. Hover a value for its setup.

The curve, in numbers

Heartbeat every 100 ms, mean delay 20 ms with jitter, six pauses a minute of up to 600 ms. The same heartbeats through four fixed timeouts:

Timeout False alarms per minute alive Detection time
150 ms 7.1measured 104 msmeasured
300 ms 3.2measured 249 msmeasured
800 ms 0.0measured 747 msmeasured
1500 ms 0.0measured 1447 msmeasured

The 800 ms timeout is quiet because no pause in this setup lasts longer than 600 ms. Raise the longest pause past 800 and it starts firing too. The detection time is a little under the timeout, because the last heartbeat before the crash had already been silent for part of an interval.

What phi buys

The same threshold adapts in both directions. On a noisy network, mean delay 100 ms with heavy jitter and no pauses, a fixed 300 ms timeout raises 5.1measured false alarms per minute, while phi at threshold 8 raises 0.9measured. It pays with slower detection, 527 msmeasured on that network. On a quiet network, low jitter and no pauses, phi 8 detects a crash in 83 msmeasured against 226 msmeasured for the fixed 300 ms.

The gain is one setting that is reasonable on networks you have not measured. The bet is no better. It is just placed for you.

What phi cannot see

Phi learns from gaps it has observed. A pause longer than anything in its window is as surprising to it as a crash, because it is the same evidence. The lab treats a gap of more than a few seconds as an outage and leaves it out of the window, as real implementations do, which also means the detector never learns to expect it. With the longest pause set to 1500 ms, the phi thresholds fire during long pauses, and so do all but the longest fixed timeouts.

The model’s limits

The simulator has one monitor and one node. Real clusters have many of each, and a suspicion in one place is not a fact everywhere. During a partition both sides suspect each other, and each side is right about its own view. That is why membership changes and failover go through a quorum rather than a local timeout, which is the subject of the Raft lesson.

The simulator also restarts the node after every crash, so it can measure detection time many times per run. It does not model a node that comes back with a different identity, which real systems handle with incarnation numbers so a wrongly suspected node can refute the rumour.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms