Hashlogics
Blog

Real-Time Apps Break When the Room Fills Up, Not in Testing

A live app that works with a handful of testers can still fall apart when a full crowd joins the same room. Usually the game is fine. What breaks is how the servers share the room.

The short version

5 things that decide this

  1. 01A real-time app can pass every test with a handful of users and still fail when one room fills up. A single socket server keeps its connections in its own memory.
  2. 02Once a second server joins, the servers need a way to pass messages to each other. Socket.IO calls that component the Adapter, and the Redis adapter does it over Redis Pub/Sub.
  3. 03Elevent's trivia platform holds sync from a small room to a full crowd. Its team added a Redis adapter during the build, because sync breaks across multiple server nodes at large scale.
  4. 04Socket.IO's own documentation says sticky sessions are still required with the Redis adapter, or clients get HTTP 400 responses.
  5. 05Load test at the number you sell. Socket.IO's performance guide says a test that stalls near 1000 connections has probably hit the open-file limit. Find limits like that before event day.
The direct answer

Why do real-time apps fail at scale when they pass every small test?

Real-time apps fail at scale because the design that works for ten users keeps connections inside one server process. Add a second server, or a thousand connections, and your players in the same room stop seeing the same thing. Design for the peak room from day one. That means a way for servers to relay events to each other, plus sticky sessions at the load balancer. Then you load test at the real player count.

The setup

A small test proves the logic, not the room

Every live app starts the same way. One developer, one server, a few browser tabs. A player answers, the server updates the score, everyone sees it. It works, and it should. Your game logic is correct.

That test answers a narrow question: does the code do the right thing for a handful of people? It can't tell you what happens when one room holds a thousand sockets. It can't tell you what happens when a second server has to share that room.

Corporate events make this worse. Many people join in one burst when the host says go, so your peak arrives all at once, on a day you can't rerun.

The mechanism

One server knows its own sockets and nobody else's

A WebSocket connection lives on the server that accepted it. When that server broadcasts a score update, it reaches only the players connected to it. On one server, that is everyone. Add a second, and the players on the other server never hear the message.

Socket.IO's documentation on using multiple nodes puts it plainly: you need some way of passing messages between processes or computers. That component is called the Adapter.

Socket.IO's Redis adapter does it with Redis Pub/Sub. According to the Socket.IO Redis adapter documentation, a packet is delivered to matching clients on the current server. It's also published in a Redis channel, where the other Socket.IO servers of the cluster receive it. That page notes that no keys are stored in Redis. If the Redis connection fails, packets reach only the clients on the current server.

There's a second trap. That documentation also says you still need sticky sessions with the Redis adapter. Skip them and you get HTTP 400 responses. A load balancer that sends one client's requests to different servers breaks the handshake before the game even starts.

  • 01Single server: all sockets are local, so broadcasts reach everyone.
  • 02Two or more servers, no adapter: each broadcast reaches only the sockets on its own server.
  • 03Same servers, with an adapter: each broadcast is relayed to the other servers, which deliver it to their own sockets.
  • 04Any load-balanced setup: sticky sessions on, or the handshake fails with HTTP 400.
What changes between a small room and a full oneLive
  1. A small room, one serverEvery socket is local. Broadcasts reach the whole room. It's easy to test.
  2. Hundreds, still one serverWorks until CPU, memory or connection limits are hit. Without a rehearsal, the limit turns up on event day.
  3. A second server addedYour room splits. Without an adapter, each server only reaches its own players.
  4. Adapter plus sticky sessionsServers relay events over Redis Pub/Sub. Sticky sessions keep each client on one server.
  5. Load test at the real numberRun it at the full player count, so limits like open files show up in rehearsal.

Game logic is identical at every step. What changes is where the room lives and how servers talk to each other.

In production

Elevent: sync from a small room to a full crowd

We built Elevent, a real-time multiplayer trivia platform for corporate events and training. Organizations run live trivia for groups from a small team to a full crowd, with scores and answers staying in sync across every player. It offers three game modes (point-based, accuracy-focused and elimination), a join-code lobby, and an admin portal for questions, rules and live sessions.

One technical decision mattered most, and it's the one this post is about. A single Socket.IO server works at low player counts, but sync breaks across multiple server nodes at large scale. So we added a Redis adapter during the build, to relay events across nodes. The stack behind it is Socket.IO with a Redis adapter, Node.js 22 with Express, Redis 7, Docker and Nginx on containerized AWS infrastructure, watched with New Relic APM.

That choice was made during the build, not as a later fix. The adapter is what lets the game run behind more than one server node. Without it, players on different nodes fall out of sync at scale.

The fix

Design for the peak room, then prove it at that number

Start from the biggest room you intend to sell. If your client wants a whole company in one session, that is the design target, not a stretch goal for later.

Put the relay in from the first sprint. In our experience, adding an adapter late means touching every broadcast path while the product is already live. Put in early, it's one more piece of setup instead of a rewrite.

Then test at the real number. Socket.IO's performance tuning guide describes the limits you'll likely meet while load testing a server. It says that if you can't go over 1000 concurrent connections, you have probably hit the open-file limit. A machine tuned past it can reach 55k concurrent connections per incoming IP. A ceiling like that is a configuration setting. It's cheap to find in a rehearsal and expensive to find in front of a ballroom.

Finally, watch the live system. Elevent is monitored with New Relic APM for uptime and real-time performance, which is the kind of visibility a live event needs.

Questions, answered

Questions this raises

01Why do WebSocket apps break when you add more servers?+

Each WebSocket connection lives on the one server that accepted it, so a broadcast from that server reaches only its own clients. Socket.IO's documentation says you need a way to pass messages between servers, which it calls the Adapter. Without one, players on different servers stop seeing the same room.

02Do you still need sticky sessions with the Socket.IO Redis adapter?+

Yes. Socket.IO's documentation states that sticky sessions are still required with the Redis adapter, and that failing to enable them results in HTTP 400 responses. Relaying events between servers is the adapter's job, but it doesn't keep one client's requests on one server.

03How do you load test a real-time multiplayer app?+

Test at the largest room you plan to sell, not at a sample. Socket.IO's performance tuning guide notes that a test stuck near 1000 concurrent connections has likely hit the open-file limit. Raise the system limits first, then test again until the real number holds.

04What does a real-time trivia platform need to scale to a full room?+

It needs an event relay between servers, sticky sessions at the load balancer, and monitoring while events run. Elevent, built by Hashlogics, holds sync from a small room to a full crowd using Socket.IO with a Redis adapter, Redis 7 and Node.js 22, monitored with New Relic.

By , CEO, HashlogicsUpdated
Start

Let’s deploy working AI into your business.

We build AI agents and automation, ship them into the tools you already run, then stay on under an agreed service level. A senior engineer reads every brief, and your call gets scheduled within 24 hours.

What happens next

  1. 01

    You send a brief or book a call

    Two minutes, whichever you prefer.

  2. 02

    A senior engineer replies within 24 hours

    Not a sales rep.

  3. 03

    Honest scoping, in writing

    And if we’re not the right fit, we say so.

Abdul Basit, CEO of Hashlogics

“I started Hashlogics because too many teams ship a demo, get paid, and disappear. We build to a standard we’d run ourselves — and we stay to keep it running.”

Abdul Basit · CEO · a direct line

Not ready to talk? Take the checklist.

12 questions to ask any AI agency before you sign. They separate a demo shop from a team that ships to production.

Get the checklist

Free · no newsletter