From 28 to 31 October 2021, Roblox was unavailable for 73 hours. The platform has around fifty million daily players, and for three days none of them could get in. No user data was lost and nobody had attacked anything. The cause was a single internal system, a Consul cluster that almost every Roblox service used to find every other service, slowing down under two unrelated performance problems at once.
The post-mortem that Roblox published in January 2022 is unusually candid about the four theories that turned out to be wrong before the right one was found. It shows how hard debugging becomes when the diagnostic tools depend on the thing that is broken.
What broke for users, and when
All times below are Pacific time, as given in Roblox's own report, and the hour counts are the ones Roblox states.
| When | What happened |
|---|---|
| 27 Oct, 14:00 | Roblox enables Consul's streaming feature on a backend service that handles traffic routing, and adds 50% more nodes to that service ahead of the year-end peak. |
| 28 Oct, 13:37 | Vault is slow and one Consul server shows high CPU load. Players are not yet affected. |
| 28 Oct, 16:35 | The number of players online falls to 50% of normal, followed by a complete outage. |
| 28 Oct, 19:00 | Most of the Consul cluster has been moved to new, larger machines. It is still unhealthy. |
| 29 Oct, 02:00 to 04:00 | First restart attempt: Consul is reset from a snapshot. It degrades again under load. |
| 29 Oct, 16:00 | Second restart attempt begins, with Consul usage cut right back. By 02:00 on 30 Oct the cluster is unhealthy again. |
| 30 Oct, 15:51 | Streaming has been disabled everywhere. Consul write latency drops back to normal. |
| 31 Oct, 05:00 | Consul and the caching system are both healthy, 61 hours in. Services are restarted. |
| 31 Oct, 16:45 | All players are allowed back, 73 hours after the start. |
What Consul does at Roblox
Roblox runs its core infrastructure in its own data centres, not in a public cloud. Its report puts the scale at more than 18,000 servers and 170,000 containers. To manage them it uses three HashiCorp tools: Nomad to schedule containers onto machines, Vault to hold secrets, and Consul.
Consul's main job is service discovery. Containers come and go, so no service can keep a fixed list of addresses for the services it calls. Each instance registers its IP address and port with Consul and reports its health, and callers ask Consul where to find a healthy instance. Roblox also used Consul for health checks, for locks, and as a key-value store.
The Consul cluster had five voting servers that hold the authoritative state, plus five non-voting read replicas. The voters use the Raft consensus algorithm: one is elected leader, every write goes through the leader, and a write counts as committed only when a majority of voters have stored it.
Now consider what depends on that cluster. A service that cannot look up its dependencies cannot call them. Nomad relies on Consul, so new containers cannot be scheduled. Vault relies on Consul, so services cannot fetch the secrets they need to authenticate. Roblox's report says it plainly: Consul was a single point of failure, and it was not healthy.
There was one more dependency, and it shaped the next two days. The telemetry systems that would have shown what was wrong also relied on Consul.
Two days of wrong theories
The first visible symptom was write latency. The median time for a write to Consul's key-value store was normally under 300 milliseconds. It was now 2 seconds. Engineers from Roblox and HashiCorp worked through a series of explanations.
- A slow machine. Hardware faults are routine at this scale, and a slow node can drag down a cluster. One node was replaced. Nothing changed.
- Too much traffic. Perhaps the cluster had outgrown its servers. The whole cluster was moved to machines with 128 cores, twice as many as before, and faster NVMe SSDs. Write latency stayed at 2 seconds. Roblox later concluded this change may have made stability worse.
- Bad state. The cluster was shut down and restored from a snapshot taken a few hours before the trouble started, with firewall rules blocking clients so it could come up quietly. It looked healthy until the rules were lifted. Then it degraded again.
- A reconnection stampede. Maybe thousands of containers reconnecting at once were too much. The team found every user of Consul, switched off non-essential use, scaled services from hundreds of instances to single digits and slowed health checks from every 60 seconds to every 10 minutes. The cluster held for some hours and then went unhealthy again, under much less load than before.
Only after that did the investigation turn from how Consul was being used to what was happening inside it. Debug logs and operating system metrics showed key-value writes blocked for long periods: contention. Moving back to 64-core machines did not help either.

Root cause one: the streaming feature
Clients of Consul need to know when the data they care about changes. The traditional way is a blocking query, also called long polling: the client sends a request that says "answer when this changes", and the server holds it open. Consul 1.10 offered a streaming alternative in which clients subscribe and the server pushes changes to them. It was designed to cut CPU use and network bandwidth on large clusters.
Roblox had turned streaming on gradually over several months without trouble. On 27 October it was enabled for the traffic routing service, whose node count was increased by half at the same moment. The cluster ran normally for a day and then tipped over.
Profiling eventually pointed at the streaming code. Performance reports from the Consul servers showed most of the time going into kernel spin locks reached through the streaming subscription path. HashiCorp's explanation was that the streaming implementation used fewer Go channels than long polling did. When both reads and writes were very heavy, activity piled up on a single channel and writes had to wait.
This also explained why bigger machines had not helped. The 128-core servers had two CPU sockets and a NUMA memory layout, in which each socket has its own local memory and reaching across is slower. More cores fighting over one shared structure, across two sockets, meant more contention.
Streaming was disabled on every Consul system. When the change finished propagating at 15:51 on 30 October, median write latency fell back to 300 milliseconds.
Root cause two: a freelist rewritten on every write
The cluster was better but not well. Whenever certain servers were elected leader, the old latency returned. During the incident the team simply stopped those servers from remaining leader. HashiCorp found the reason in the following days.
Consul stores its Raft log in BoltDB, an embedded storage library. The log is a rolling record of operations. Periodically Consul writes a snapshot of its current state and deletes the oldest log entries.
BoltDB keeps its data in one file divided into 4 kB pages. Deleting data does not shrink the file. As the bbolt documentation explains, pages cannot be handed back to the disk, so the library keeps a free list of unused pages inside the file and reuses them for later writes. That list has to be saved to disk as well.
On the affected servers the numbers were extreme. Roblox's report shows a log store of 4.2 GB that held only 489 MB of real data. The remaining 3.8 GB was free pages, nearly a million of them, and the freelist that recorded them was 7.8 MB.
log file size 4.2 GB
live data 489 MB
free space 3.8 GB (nearly a million 4 kB pages)
freelist size 7.8 MB
one Raft log append 16 kB or less
written per append 16 kB + 7.8 MB
Every append to the Raft log therefore wrote a fresh copy of a 7.8 MB freelist. A leader has to persist each log entry before it can be committed, so a leader with a bloated file was slow at the one operation everything else waits on.
The immediate fix was to compact the database files with existing BoltDB tooling. The longer-term fix is a newer Consul that uses bbolt, the maintained successor to BoltDB, which Roblox says does not have the unbounded freelist growth.
Bringing it back, and what Roblox changed
At 54 hours Consul was stable. Roblox was still down, because much of the system had been switched off during the investigation and had to be started from nothing.
The caching layer went first. In normal operation it handles a billion requests per second across its tiers. The databases beneath it were unharmed, so the simplest path was to redeploy the caches. That hit its own problems: scheduling data kept in Consul's key-value store was wrong after the snapshot reset, one unhealthy node looked empty to the scheduler and attracted jobs that then failed, and the deployment tool had been built for small changes to a running system, not for bootstrapping a large one.
With caches healthy at 05:00 on 31 October, the remaining services were restarted and checked. Players were then admitted gradually. Roblox used DNS steering to send a randomly chosen share of players to the real service and the rest to a maintenance page, raising the share in steps of roughly 10% while watching database load and cache performance.
The changes Roblox listed afterwards:
- Telemetry no longer depends on the systems it monitors, and now covers Consul and BoltDB in detail, with alerts for the conditions seen in this outage.
- Servers and networking were built for a second, geographically separate data centre, with work under way on multiple availability zones.
- Some critical services were moved to their own dedicated Consul clusters, obsolete key-value data was deleted, and data that did not belong in Consul's key-value store is being moved elsewhere.
- Consul is being upgraded to a version that uses bbolt.
- Cache deployment was redesigned so the caching system can be started quickly from a standing start.
- Streaming stays off until a reworked implementation has been tested at Roblox's scale.
The computer science underneath
Service discovery. In a container platform, addresses are temporary, so services look each other up in a registry at run time. API gateways and service discovery explains registration, health checks and lookups. The registry becomes the most critical dependency in the system: if it is slow, everything is slow.
Consensus and the replicated log. Raft keeps several servers in agreement by having a leader append each change to a log and replicate it to a majority before it is committed. Consensus and leader election walks through this. The consequence here is that write throughput for the whole cluster is bounded by how fast the leader can append to its own log. The idea of writing to a durable log before applying a change is the same one covered in write-ahead logging and crash recovery.
Pages and free space. Storage engines divide files into fixed-size pages and must track which pages are free. Pages, heap files and the buffer pool covers that layout. How the free-space map is stored matters: a structure that is cheap when it has a thousand entries can dominate every write when it has a million.
Contention. Adding cores speeds up work that can run in parallel. Work that queues for one shared structure does not get faster, and the cost of handing that structure between cores grows. Spinlocks, reader-writer locks and lock-free ideas explains why a waiting thread burns CPU while making no progress, which is exactly what the profiles showed.
What an interviewer could ask from this
Why did one unhealthy cluster stop the whole platform? Service discovery, the scheduler and the secrets store all depended on it. Without lookups, services cannot reach each other, and without the scheduler and secrets, nothing new can start.
Why did doubling the cores not help, and possibly hurt? The bottleneck was contention on a shared structure, not a shortage of CPU. More cores means more threads competing for it, and across two NUMA sockets each hand-off is more expensive.
In Raft, why does a slow disk on the leader slow every write? The leader must persist an entry to its own log and have a majority acknowledge it before the entry is committed. Clients wait on that sequence.
What is a freelist in a page-based store, and how can it hurt writes? It records which pages are unused so they can be reused. If the whole list is rewritten on each commit, its size is added to every write, however small the actual change.
Why not let all users back the moment the system is healthy? Caches are empty, so every request reaches the databases. Admitting users in stages lets caches warm and exposes problems while the load is still small.
Takeaways
- Two independent faults overlapped: lock contention in a new streaming path under heavy read and write load, and a storage file whose freelist had grown to 7.8 MB and was rewritten on every log append.
- A shared coordination service is a single point of failure for everything that uses it, including, in this case, the telemetry needed to diagnose it.
- More hardware does not fix contention. Profile first.
- A cold start is its own engineering problem. Tools built for small changes to a running system may not be able to build that system from nothing.












