Early in the development of a clustered message broker, developers focused on selecting a single consistency model for the entire system. This approach led to a design flaw where every pod, upon booting, loaded all client session states into memory. This occurred because the system was designed to be ready to serve any client, leading to an unfiltered read of all stored session data, not just the data relevant to clients that would connect to that specific pod.
The design flaw manifested as out-of-memory (OOM) errors, with pods being killed by the kernel's OOM handler. Despite a memory limit of 512Mi, pods consumed excessive memory. Initial hypotheses, such as load-balancer imbalance, were disproven by metrics showing similar memory usage across pods even with vastly different connection counts. A pod serving 130 times more connections than another had nearly identical memory consumption, indicating a fundamental design issue rather than a load distribution problem.
Investigation into the code responsible for session state revealed that a persistence hook on pod boot loaded the entire fleet's client session state, not just a fraction. This meant every row returned from the initial read became a live in-memory object. The design implicitly assumed that a node should be prepared to serve any client, leading to this inefficient memory allocation.
The core lesson from this incident is that distributed systems should not seek a single consistency model for the entire cluster. Instead, the focus should be on determining the specific consistency guarantee each piece of state actually needs. Adopting this state-oriented consistency approach can simplify the overall design of distributed systems and prevent resource-related issues by tailoring data handling to its specific requirements.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
A distributed systems design issue was identified where a clustered message broker experienced out-of-memory errors due to loading all client session states on every pod boot. This incident highlighted that different pieces of state within a distributed system require different consistency guarantees, rather than a single, system-wide consistency model. Adopting a state-oriented consistency approach can simplify distributed system design and prevent resource issues.