Load Balancing 100,000 WebSockets (and Somehow Surviving It)
dev.to·5h·
Discuss: DEV
Flag this post

HAProxy, Nginx, and one bad idea that taught me more about scaling than any tutorial ever did.

When the Graph Went Vertical

It didn’t start with a bang. It started with graphs. You know the kind the “oh cool, traffic is up!” kind that turns into the “wait, why is everything red?” kind before your next sip of coffee.

The dashboards weren’t just spiking; they were ascending. CPU at 98%. RAM evaporating like your confidence in distributed systems. Connections kept climbing, long after they should’ve stopped.

That’s when it hit us: we were sitting on 100,000 live WebSocket connections. Not “requests per second.” Not “unique users.” Actual, ongoing, needy little sockets that refused to hang up.

Each one was clinging to a thread of server memory like a cat danglin…

Similar Posts

Loading similar posts...