Numbers from the laptop (i7-1270P, Docker Desktop on WSL2, a Samsung PM9A1 NVMe), five nodes in containers, each result committed with the code that produced it. The design notes behind them, including what didn't work, are in the repository.
How long a succession takes
The Don is killed with SIGKILL under 200 writes a second, ten times per election timeout. The gap is the widest silence between two acknowledged writes, as a client sees it.
| election timeout | clients waited, median | range | new Don chosen after |
|---|---|---|---|
| 150ms | 194 ms | 179–233 ms | 178 ms |
| 300ms | 378 ms | 352–714 ms | 355 ms |
| 600ms | 706 ms | 641–814 ms | 713 ms |
| 1s | 1,206 ms | 1,122–1,449 ms | 1,173 ms |
What a short election timeout costs
No family is killed here. Under a steady 300 writes a second, a disk stall or a frozen event loop is forced on the Don or a follower five times each, and the table counts how many of those were followed by a succession that shouldn't have happened.
| fault | timeout 150 ms | timeout 300 ms | timeout 600 ms | timeout 1,000 ms |
|---|---|---|---|---|
| disk stall of 100 ms on the leader | 0 of 5 | 0 of 5 | 0 of 5 | 0 of 5 |
| disk stall of 300 ms on the leader | 0 of 5 | 0 of 5 | 0 of 5 | 0 of 5 |
| disk stall of 1,000 ms on the leader | 0 of 5 | 0 of 5 | 0 of 5 | 0 of 5 |
| disk stall of 1,000 ms on the follower | 0 of 5 | 0 of 5 | 0 of 5 | 0 of 5 |
| pause of T/2 on the leader | 0 of 5 | 0 of 5 | 0 of 5 | 0 of 5 |
| pause of T on the leader | 0 of 5 | 0 of 5 | 0 of 5 | 0 of 5 |
| pause of 2T on the leader | 5 of 5 | 5 of 5 | 5 of 5 | 5 of 5 |
| pause of 2T on the follower | 0 of 5 | 0 of 5 | 0 of 5 | 0 of 5 |
| fault, storage waited on in the loop | timeout 300 ms | timeout 1,000 ms |
|---|---|---|
| disk stall of 100 ms on the leader | 0 of 5 | 0 of 5 |
| disk stall of 300 ms on the leader | 0 of 5 | 0 of 5 |
| disk stall of 1,000 ms on the leader | 5 of 5 | 0 of 5 |
Throughput and latency
Open-loop writes on a quiet cluster, doubling the rate until a step falls behind (under 90% of the offered rate, p99 over a second, or more than 1% failed), then two steps of bisection. The knee is the highest rate that kept up. Where a row ran three interleaved rounds, the knee is the median with the range. Latency comes from a run at 80% of the knee, or the nearest lower step that kept up.
| configuration | knee, writes/s | latency taken at | p50 | p99 | fsyncs per write | messages per write |
|---|---|---|---|---|---|---|
| 5 nodes | 5,000 (4,000–6,000) | 4,000 | 15 ms | 65 ms | 0.15 | 8.5 |
| 3 nodes | 8,000 (7,000–8,000) | 6,400 | 36 ms | 75 ms | 0.06 | 3.9 |
| 7 nodes | 6,000 (every round) | 4,800 | 46 ms | 80 ms | 0.13 | 12 |
| 5 nodes, one entry per append | 5,000 | 4,000 | 45 ms | 79 ms | 0.13 | 8.3 |
| 5 nodes, no pipelining | 8,000 | 4,000 | 13 ms | 36 ms | 0.17 | 0.29 |
| 5 nodes, 1 KiB values | 5,000 | 4,000 | 34 ms | 444 ms | 0.15 | 8.3 |
| 5 nodes, no cap on pending writes | 7,000 (6,000–7,000) | 5,600 | 41 ms | 155 ms | 0.09 | 7.7 |
| 5 nodes, one event per Ready | 7,000 | 5,600 | 44 ms | 78 ms | 0.10 | 15 |
Three nodes stay ahead (7,000 to 8,000). Five and seven overlap, and the same five-node setup ranged from 4,000 to 7,000 over six rounds that evening. Taking the whole queue into one Ready halved the messages per write but didn't move the knee: one event per Ready reached 7,000 too. Without pipelining the appends wait for each other and carry dozens of entries, which reached 8,000 in its one round. Past the knee the cluster still collapses rather than slowing down, with or without the cap on pending writes.
What durability costs
The same five nodes with different fsync policies on the NVMe under WSL2. "No fsync" is unsafe and only here as a floor.
| configuration | knee, writes/s | latency taken at | p50 | p99 | fsyncs per write | messages per write |
|---|---|---|---|---|---|---|
| group commit | 5,000 | 4,000 | 41 ms | 73 ms | 0.13 | 8.2 |
| one fsync per write | 110 | 88 | 11 ms | 15 ms | 5.0 | 18 |
| one fsync per entry | 110 | 88 | 11 ms | 16 ms | 5.0 | 18 |
| no fsync (unsafe) | 24,000 | 19,200 | 4.4 ms | 41 ms | 0 | 7.8 |
| group commit, leader writes before sending | 4,000 | 3,200 | 18 ms | 29 ms | 0.21 | 5.1 |
A flush takes about 9 ms on this disk, so one per write holds every node to about 110 writes a second. Group commit flushes about 40 entries at once near its knee. At low load the flush is nearly all of a write's latency: 13 ms with it, under a millisecond without. Writing on the leader before sending its appends reached 4,000 against 5,000 for writing in parallel, and added about 3 ms at low load (15.4 against 12.8 ms).
Four ways to read
Reads through the log, ReadIndex, the leader's lease and ReadIndex on followers, at 95% and 50% reads. The unsafe local read is a planted bug, here as a floor.
| read path and share | knee, ops/s | latency taken at | read p50 | read p99 | write p99 | messages per op |
|---|---|---|---|---|---|---|
| lease reads, 0.95 | 16,000 (every round) | 12,800 | 11 ms | 47 ms | 94 ms | 0.47 |
| index reads, 0.95 | 12,000 (every round) | 9,600 | 26 ms | 73 ms | 80 ms | 14 |
| follower reads, 0.95 | 20,000 | 16,000 | 35 ms | 279 ms | 253 ms | 5.1 |
| log reads, 0.95 | 6,000 | 4,800 | 42 ms | 69 ms | 68 ms | 8.2 |
| local reads (unsafe), 0.95 | 32,000 | 25,600 | 0.6 ms | 71 ms | 153 ms | 3.3 |
| lease reads, 0.5 | 8,000 | 6,400 | 0.7 ms | 26 ms | 56 ms | 4.4 |
| index reads, 0.5 | 5,000 | 4,000 | 33 ms | 72 ms | 81 ms | 12 |
| follower reads, 0.5 | 4,000 | 3,200 | 27 ms | 85 ms | 93 ms | 10 |
| log reads, 0.5 | 5,000 | 4,000 | 39 ms | 66 ms | 66 ms | 8.2 |
| local reads (unsafe), 0.5 | 10,000 | 8,000 | 0.6 ms | 56 ms | 67 ms | 5.7 |
| index reads, 0.95, one event per Ready | 8,000 | 6,400 | 27 ms | 107 ms | 109 ms | 16 |
| index reads, 0.5, one event per Ready | 4,000 | 3,200 | 27 ms | 429 ms | 435 ms | 15 |
A lease read answers in a third of a millisecond and costs no messages until the leader is busy with writes. ReadIndex reached 12,000 in all three rounds against the lease's 16,000: reads that queue up share a heartbeat round, though below the knee one still costs about 14 messages, because there is rarely more than one waiting. ReadIndex on followers reached 20,000, more than the lease, because the reads themselves leave the leader. With half the operations writes, every path is limited by the writes.
Next to etcd
etcd 3.6.15 with the same timeouts, CPU pinning and load. etcd keeps a full MVCC history on disk and FiveFamilies keeps its state in memory, so FiveFamilies does less work per write.
| configuration | knee, ops/s | latency taken at | p50 | p99 | fsyncs per op | messages per op |
|---|---|---|---|---|---|---|
| fivefamilies, 3 nodes, writes | 6,000 | 4,800 | 35 ms | 67 ms | 0.08 | 4.1 |
| etcd, 3 nodes, writes | 24,000 | 19,200 | 53 ms | 176 ms | 0.02 | not counted |
| fivefamilies, 5 nodes, writes | 6,000 (6,000–7,000) | 4,000 | 15 ms | 60 ms | 0.15 | 8.5 |
| etcd, 5 nodes, writes | 16,000 (16,000–20,000) | 12,800 | 52 ms | 135 ms | 0.04 | not counted |
| etcd, 5 nodes, writes, client on the leader only | 12,000 | 9,600 | 29 ms | 94 ms | 0.06 | not counted |
| fivefamilies, 5 nodes, ReadIndex reads 0.95 | 12,000 | 9,600 | 25 ms | 62 ms | 0.06 | 14 |
| etcd, 5 nodes, linearizable reads 0.95 | 32,000 | 25,600 | 78 ms | 162 ms | 0.02 | not counted |
| fivefamilies, 5 nodes, local reads (unsafe) 0.95 | 40,000 | 32,000 | 0.8 ms | 119 ms | 0.01 | 3.0 |
| etcd, 5 nodes, serializable reads 0.95 | 32,000 | 25,600 | 1.2 ms | 60 ms | 0.02 | not counted |
etcd still wins on everything that goes through consensus: 2.7 times the writes on five nodes and 4 times on three, 2.7 times the linearizable reads. FiveFamilies' unsafe local reads beat etcd's serializable ones (40,000 against 32,000), and at low load FiveFamilies writes faster (11 to 13 ms against 23 to 37 ms). Past their knees etcd slows down and keeps answering, but FiveFamilies falls over. etcd's five-node write median is a lower bound: in one round the step above it was ruled invalid because the load generator itself fell behind.
Taking the whole queue into one Ready
After the runs above, the server loop takes everything queued, up to 256 events, before it asks Raft for a Ready. One event per Ready is the old behaviour, kept as a switch for this comparison, and both ran back to back on the same evening.
| configuration | knee, ops/s | latency taken at | p50 | p99 | fsyncs per op | messages per op |
|---|---|---|---|---|---|---|
| writes, queue taken in one Ready | 6,000 | 4,000 | 27 ms | 66 ms | 0.14 | 8.4 |
| writes, one event per Ready | 5,000 | 4,000 | 44 ms | 80 ms | 0.13 | 16 |
| ReadIndex at 95% reads, queue taken in one Ready | 14,000 | 11,200 | 33 ms | 96 ms | 0.04 | 13 |
| ReadIndex at 95% reads, one event per Ready | 8,000 | 6,400 | 26 ms | 160 ms | 0.07 | 16 |
ReadIndex gained the most: reads that queue up share a heartbeat round, the knee went from 8,000 to 14,000, and offered 16,000 a second the cluster still served 13,178 instead of 27. Writes send about half the messages (8 against 15 per write at 4,000 a second), but their knee moved by less than run-to-run noise, so something else holds writes back.
Where the time goes
Go profiles of the Don under steady writes on five nodes. At 4,000 writes a second it used 54% of its CPU, and half of that went to write syscalls flushing gRPC streams, mostly to the followers. The loop with Raft, the store and the bookkeeping was 6%. At 6,000 a second it used 39%, with bigger batches and fewer flushes, and its request handlers spent their time waiting for commits, not for locks. So CPU time doesn't set the knee.
Overloaded at 10,000 writes a second for 15 s, the cluster served 218 a second. With the Don refusing writes past 4,096 uncommitted entries it served 267, with 5,099 refusals and 85,629 timeouts: the cap bounds the queue inside Raft, but most writes waited in front of the event loop (refusing once that queue is full came later). After both overloads it went back to 4,000 a second cleanly.
How long a dead service stays listed
An instance registered with a 2 s lease is killed, and a client watching the registry times how long it still sees it. A new Don gives every lease its full time again, so losing the Don as well adds an election.
| what died | median | min | max | kills |
|---|---|---|---|---|
| the instance | 1,750 ms | 1,475 ms | 2,078 ms | 10 |
| the instance and the Don | 3,184 ms | 3,066 ms | 3,365 ms | 10 |
Real faults, checked
Kills, pauses, partitions, slow links, membership changes and leadership handovers on a real five-node cluster, with every client operation recorded and the whole history checked for linearizability afterwards.
| run | faults | operations | linearizable | states equal |
|---|---|---|---|---|
| 20261015-seed2-3m | 27 in 180 s | 41,208 | yes | yes |
| 20261016-seed3-3m-members | 27 in 180 s | 48,902 | yes | yes |
| 20261016-seed4-3m-membership-heavy | 32 in 180 s | 49,766 | yes | yes |
| 20261017-seed5-3m | 32 in 180 s | 51,012 | yes | yes |
| 20261017-seed6-3m-members | 30 in 180 s | 49,896 | yes | yes |
| 20261017-seed7-3m-membership-heavy | 39 in 180 s | 46,732 | yes | yes |
Bugs planted on purpose
The same checks against builds with a known bug switched on, to show what the net catches on a real cluster and what it doesn't. The simulator catches every one of them. These runs were 90 seconds each.
| bug | operations | linearizable | states equal | caught |
|---|---|---|---|---|
| anyvote | 2,002 | Illegal | no | yes |
| figure8 | 20,026 | yes | yes | not in 90 s |
| prevterm | 23,129 | yes | yes | not in 90 s |
| staleterm | 21,504 | yes | yes | not in 90 s |
| anyvote | 15,937 | Illegal | yes | yes |
| figure8 | 24,218 | yes | yes | not in 90 s |
| prevterm | 25,794 | yes | yes | not in 90 s |
| staleterm | 23,086 | yes | yes | not in 90 s |