Recreating a Two Million Particle World at 30 Hz over WebSocket with Centrifugo
The article discusses the challenges of recreating a two million particle simulation using the Centrifugo WebSocket protocol. It highlights the differences in data transmission between the original simulation and the Centrifugo implementation, particularly in terms of bandwidth usage. The authors detail their findings and the implications for user experience and scalability.
- ▪David Gerrells created a Go server that simulates two million particles in a 2200 × 2200 world at 60 Hz.
- ▪The Centrifugo implementation resulted in a fivefold increase in data sent to each viewer compared to the original simulation.
- ▪Centrifugo's design as a standalone broker means it cannot optimize data transmission based on individual viewer needs.
Opening excerpt (first ~120 words) tap to expand
May 21, 2026·16 min readRecreating a Two Million Particle World at 30 Hz with CentrifugoRecreating David Gerrells' 2M-particle multiplayer simulation on top of Centrifugo WebSocket protocol. The naive single channel fanout balloons each tick from 129KB to 605KB. We explore how to improve that given Centrifugo nature and good UX in mind.David Gerrells wrote a blog post How fast is Go - simulating millions of particles on a smart TV — describing a Go server that simulates two million particles in a 2200 × 2200 world at 60 Hz, ships frames to clients at 30 Hz over WebSocket, and lets anyone connected pull particles around with their cursor. The transport is hand-written for speed: bit-packed binary frames, manual protocol, raw WebSocket library.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Centrifugal.