Skip to content
System Designer

Work later · 3 minutes

Live sockets and presence

Chat and live scores keep a connection open; that changes how you count capacity.

Open this lesson
Chat and live scores keep a connection open; that changes how you count capacity.

Open lines

Normal web requests ask and leave. A live feature, like chat, keeps a connection open so the server can push messages the moment they happen. A server can hold tens of thousands of open lines (approx.), but each one uses memory even when quiet.

Who is online

An open connection consumes memory. Presence is a separate, expiring observation, so a silent disconnect can briefly leave a person online.

Try the idea

Chat messages overwhelm the app servers. Add a websocket gateway to hold the connections.

Key numbers

Open connections per gateway node
≈ 100,000. approx.
Memory per connection
≈ 10 KB. approx.
One million users online
≈ 10 nodes. 1,000,000 / 100,000, plus spare room (approx.)

Check your reasoning

Think through these questions before opening the lesson. In the game you can test the idea and compare your reasoning.

  • Why is a live feature costly when users are quiet?
  • Where should "online now" be stored?
  • A gateway server restarts. What happens to its users?

The key point

Count open connections, not just requests, and keep presence light.

Practise this idea

Continue through the lesson tracks