Mike Burrows built Chubby to solve a modest coordination problem: give GFS, Bigtable, and MapReduce a fault-tolerant, coarse-grained lock service so teams would stop rigging ad hoc leader elections or paging human operators on failure. In production, Chubby mutated into something far bigger: a strongly consistent small-file name server handling up to 90,000 direct clients on a single 2-CPU 2.6GHz Xeon master, where 93% of all RPCs were KeepAlive heartbeats and lock acquisitions made up just 31 parts per million.

That gap between intended design and messy production reality is why the 2006 OSDI paper remains essential reading. Chubby directly inspired Apache ZooKeeper and modern control-plane stores like etcd, and Section 4 is still one of the most candid field reports ever written on how real developers abuse consensus-backed locks, caches, and failover events.

  • Lock service over a Paxos library: Google already had a client Paxos library, yet prototypes rarely planned for consensus early; exposing a familiar UNIX-like file and lock service over five-replica consensus let even a single client make progress safely.
  • Sequencers fence zombie lock holders: Advisory locks cannot stop a stalled client’s delayed packet from corrupting storage; Chubby issues opaque sequencers (name, mode, lock generation) for downstream servers to verify, plus a 1-minute max lock-delay fallback.
  • Invalidations replace DNS TTL polling: A 3,000-process all-to-all job with a 60s DNS TTL generated 150,000 lookups/sec (3x a 50k/s DNS server’s limit); Chubby’s lease-backed client caches hold arbitrary keys indefinitely via constant KeepAlive traffic.
  • Real workload numbers: In a representative cell snapshot (22k direct + 32k proxied clients, 1 to 2k RPC/s), 60% of open files were naming-related, 90% of stored files were under 1KB, SetContents was 680 ppm, and Acquire was 31 ppm.
Inside a Chubby cell: consensus replicas, leases, and production workload
1. Five-replica cell
Replicas sit in separate racks and elect one master via Paxos with a multi-second master lease.
RAM database + quorum writes
Master serves reads straight from RAM; writes commit once replicated to a majority quorum and backed up to a cross-building GFS cell.
2. Sessions & caching
Blocked KeepAlive RPCs (12s default, up to 60s under load) deliver events and cache invalidations.
Strict invalidation + 45s grace period
Master blocks writes until caching clients ack invalidation or expire; on local timeout, clients flush caches and hold locks for a 45s jeopardy grace window.
3. Snapshot mix (§4.1)
22k direct + 32k proxied clients; 230k cache entries across 24k files plus 32k negative entries.
93% KeepAlive, 0.0031% Acquire
At 1 to 2k RPC/s: 93% KeepAlive, 2% GetStat, 1% Open, 1% CreateSession, 0.4% GetContentsAndStat, 680 ppm SetContents, 31 ppm Acquire.

Cell architecture and traffic snapshot from Burrows (2006), Sections 2 and 4.1.

Why coarse-grained advisory locks and sequencers beat naive locking

Burrows starts Section 2.1 with a defense of why Chubby exists at all when Google already maintained a client-side Paxos library. In theory, a consensus library eliminates extra infrastructure dependencies. In practice, systems start as low-load prototypes without consensus; once they grow and need fault-tolerant primary election, bolting on a replicated state machine forces an invasive rewrite. Calling a lock service requires just two statements and one extra RPC field. Better still, Chubby acts as a generic five-replica electorate: a client system can stay safe even when only a single client process remains alive.

Chubby deliberately targets coarse-grained locks held for hours or days (such as appointing a GFS master or partitioning Bigtable tablets), not sub-second transactional mutexes. Coarse locks keep lock-acquisition rate decoupled from application transaction throughput, make brief lock-server failovers painless, and justify persisting locks across server crashes. Even when Section 2.1 sketched a way for clients to run their own fine-grained lock servers backed by Chubby, Section 4.6 notes that no team ever needed it: optimizing distributed apps meant eliminating coordination calls altogether.

Equally deliberate was making every Chubby lock advisory (reader-writer) rather than mandatory, and pairing it with sequencers to catch delayed packets. A paused process holding lock L can emit a write R, freeze while its session expires, and watch another client take L before R finally reaches the storage server. Simply holding a lock cannot stop out-of-order network delivery. With Chubby, a lock holder calls GetSequencer() to obtain an opaque byte string containing the lock name, acquisition mode, and 64-bit lock generation number, then attaches it to downstream RPCs. The storage server checks it via CheckSequencer() (or locally against the highest generation it has seen) and rejects stale zombie writes. For legacy servers that cannot check sequencers, Chubby offers a lock-delay (up to 1 minute) after an involuntary lock drop, an imperfect delay rather than a strict proof.

Three design choices Chubby explicitly rejected
Mandatory locks

Locks often guard external GFS or Bigtable state; mandatory enforcement would break emergency debugging and still miss buggy non-lock writes.

Time-based DNS TTLs

A 60s TTL on a 3,000-node job forces 150k lookups/sec (3x a 50k/s DNS server); explicit cache invalidations stay flat over KeepAlives.

Update-push caching

Pushing every new file version causes unbounded traffic to idle watchers; invalidating once and marking the node uncachable bounds master work.

Tradeoffs from Burrows (2006), Sections 2.4, 2.7, and 4.3.

How sessions, caching, and the 45-second grace period survive failover

Chubby’s file interface intentionally looks like a stripped-down UNIX tree (/ls/cell/path/node) without hard links, cross-directory renames, directory mtimes, or path-based ACL inheritance. Every node is either permanent or ephemeral (deleted once no client holds it open, ideal for liveness markers) and carries four monotonically increasing 64-bit generation numbers (instance, content, lock, and ACL) plus a 64-bit checksum so SetContents() can perform compare-and-swap. Whole-file reads and writes discourage large blobs.

To absorb read-heavy traffic from tens of thousands of clients without sacrificing strong consistency, Chubby maintains a write-through, lease-backed client cache covering file data, metadata, open handles, and file absence (negative caching). Clients keep one KeepAlive RPC parked at the master at all times. Under normal operation, the master blocks that KeepAlive until the client’s 12-second session lease nears expiry (extending up to 60 seconds when overloaded), then replies with a new lease window. Whenever a file changes, however, the master blocks the modification and returns pending KeepAlive calls early with cache invalidations. Because a client cannot renew its session lease without acknowledging invalidations, stale reads never happen; and because every RPC originates at the client, traffic crosses one-way firewalls cleanly.

What happens when a master crashes and election takes longer than the 12-second lease? Typical failovers finish in 4 to 6 seconds, though Section 2.2 cites spikes up to 30 seconds. When a client’s conservative local lease timer expires (Figure 2), it does not immediately panic and drop locks. Instead, it flushes its cache, blocks API calls, fires a jeopardy event so heavyweight services can pause rather than abort, and enters a 45-second grace period. Because the authoritative lease timer stopped when the old master died and the new master conservatively extends prior leases on election, reconnecting within those 45 seconds delivers a safe event and lets the application continue without losing its locks or restarting.

Initially, the team persisted every new session to Berkeley DB on creation, then tried deferring DB writes to first mutation or probabilistic KeepAlive ticks to avoid startup overload (Section 4.4). That optimization introduced a subtle bug: young read-only sessions could vanish across a failover, letting them read stale caches briefly if every recorded session checked in early. Chubby eventually eliminated on-disk session records altogether, recreating sessions from client handle epochs after waiting one worst-case lease timeout on failover, which also unlocked stateless proxy servers capable of cutting KeepAlive traffic by factors of 10,000 or more.

Five production surprises that forced Chubby to evolve

Chubby’s Section 4 is a reminder that even careful distributed protocols get stress-tested in places their designers never anticipated. Switch through the five tabs below to see how unexpected workloads, client bugs, and transport behaviors forced concrete changes in production.

Five production surprises that reshaped Chubby

Select a surprise (or use Left and Right arrow keys) to compare what happened in production, why the initial design broke, and how Burrows's team fixed it.

Quadratic job lookups turned Chubby into Google's name server

Section 4.3

Instead of mostly holding locks, 60% of open files and 46% of stored files became naming entries for large all-to-all jobs.

Why naive fix breaks
Starting a 3,000-process all-to-all job generated 9 million individual name lookups and brought the Chubby master to its knees.
Chubby's fix
Batched ~100 process endpoints into single Chubby files and added a Chubby DNS converter plus name-specific protocol servers.
Measured scale
Where a 2-CPU 2.6GHz Xeon DNS server topped out at 50k lookups/sec, a single Xeon Chubby master served 90,000 direct clients steadily.
Design hindsight
Name lookups only need timely notification, not strict cache consistency; full Chubby proxies earlier could have avoided custom naming servers.

Source: Burrows (2006), Sections 4.2 through 4.6.

If you prefer the short version without clicking through the tabs, here are the five production lessons from Section 4:

  • Name service dominance: quadratic job startups flooded Chubby with 9 million lookups until batching (~100 entries/file) and protocol converters let one master handle 90,000 clients.
  • Retry loops and Java: negative caching (32k entries vs. 24k positive) and handle reuse absorbed tight polling loops, while Java’s JNI friction forced a separate protocol-conversion server.
  • Storage quotas: missing limits allowed a 1.5MB file rewrite per user action; Chubby added a 256KB file cap, though migrating existing services still took a year.
  • UDP KeepAlives: TCP backoff missed 12-second session lease deadlines during congestion, forcing UDP KeepAlives (and revealing that Close()/Poison() needed a separate Cancel() RPC).
  • Failover discipline: applications that crashed or triggered 10-minute recoveries on master failover events turned sub-30-second blips into major outages.

Caveats, outage numbers, and lessons for modern coordination

Three caveats frame Chubby’s numbers and design boundaries.

First, software bugs caused all six data-loss incidents. Across 700 cell-days of availability tracking (excluding scheduled datacenter power-downs), Chubby recorded 61 outages: 52 lasted under 30 seconds (most under 15s), and the 9 longer ones came from network maintenance (4), network connectivity (2), software bugs (2), and overload above 90,000 sessions or uncached read storms (1). Across dozens of cell-years, however, Chubby lost data six times: four from database software bugs (including early Berkeley DB replication bugs that prompted Google to write its own WAL-and-snapshot store) and two from operator errors during upgrades meant to patch those bugs, with zero hardware-caused losses.

Second, global availability is not the same as local availability. Chubby’s global cell (/ls/global/master) spans five widely separated datacenters so it rarely goes down globally, yet clients observe higher availability from their local cell because local links partition less often and datacenter power maintenance knocks out client and local cell together (Section 4.6).

Third, Chubby solves coarse coordination, not consensus research or data-plane storage. Burrows explicitly writes that Chubby claims no new consensus algorithms: it runs Paxos under FLP timing assumptions for master leases. Its whole-file 256KB cap, in-memory footprint, and invalidation-based cache make it a poor fit for pub/sub or high-write tables. In modern stacks, Raft replaced Chubby-style opaque multi-Paxos in etcd and Consul, while Spanner took over globally consistent transactional state at scale.

For engineers building distributed systems today, Chubby’s enduring rule is deceptively simple: keep coordination off the data path, treat every distributed lock as advisory unless backed by a monotonically increasing fencing token (a sequencer), and design client libraries so a 15-second control-plane hiccup is a quiet pause rather than a fleet-wide stampede.