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
KeepAlivetraffic. - 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,
SetContentswas 680 ppm, andAcquirewas 31 ppm.
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.
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.
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.3Instead 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.
Polled opens and missing files hammered the master
Section 4.5Developers wrote tight retry loops on absent files and repeatedly opened and closed handles instead of keeping handles open.
- Why naive fix breaks
- Adding artificial exponential Open() delays exposed bugs only slowly and required constant manual reviews; devs barely noticed delays under 10s.
- Chubby's fix
- Added negative caching (32k negatively cached names vs. 24k positive files in Section 4.1) and handle reuse so repeated Open() calls hit local RAM.
- Java wrinkle (§4.2)
- Java teams disliked JNI around the 7,000-line C++ client library; Google built a Java protocol-conversion server rather than porting delicate lease logic.
- Rule of thumb
- Design reviews now reject any client pattern whose Chubby RPCs, disk space, or file count grow linearly with end users without a throttling knob.
Missing quotas let one reused module swallow a cell
Section 4.5A metadata module built for rare small uploads was reused by two high-volume teams until one 1.5MB file was rewritten whole on every user action.
- Why naive fix breaks
- Whole-file atomic reads and writes without quotas let that single service consume more storage than every other Chubby client combined.
- Chubby's fix
- Enforced a hard 256KB file-size cap and worked with teams to migrate bulk state to proper storage systems.
- Migration friction
- Even with clear overload, moving busy production services off the misused schema took roughly a year.
- Pub/sub abuse
- Several teams also tried building Zephyr-style pub/sub over Chubby events; invalidation-based caches made it too slow and reviews caught it early.
TCP backoff broke 12-second session leases under congestion
Section 4.6Piggybacking invalidations onto KeepAlives looked clean until TCP's congestion backoff starved lease renewals during network bursts.
- Why naive fix breaks
- TCP's exponential retransmission backoff ignores higher-level lease deadlines, causing widespread session expirations during transient congestion.
- Chubby's fix
- Switched KeepAlive RPCs from TCP to UDP so lease timing bounds stay predictable under congestion.
- Planned split
- To avoid running un-congested UDP for large payloads, the team planned a TCP GetEvent() RPC while keeping unacked event lists on UDP KeepAlives.
- Handle API regret
- Canceling blocking Acquire() calls via Close()/Poison() tore down server handle state and blocked multi-thread sharing; a dedicated Cancel() RPC was needed.
Clients amplified brief failovers into 100x outages
Section 4.6Developers treated Chubby as infinitely available or interpreted master-failover notifications as fatal crashes.
- Why naive fix breaks
- One team launched 10-minute cluster-wide recovery across hundreds of machines on every Chubby master election, multiplying failures 100x.
- Chubby's fix
- Wrapped fragile APIs in higher-level libraries, audited usage patterns in design reviews, and noted failover events should replay file-change events instead.
- Outage reality
- Across 700 cell-days (Section 4.1), 52 of 61 non-maintenance outages lasted under 30s (most under 15s), easily weathered by apps that stay calm.
- Global vs. local
- Although the multi-continent global cell is almost always up, local cells gave higher client-observed availability due to fewer WAN partitions.
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 (
32kentries vs.24kpositive) 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 separateCancel()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.


