Try
↑ ↓ move↵ openesc close

Interview prep / Chat system

Mid · Chat system · System design interview question

Estimate the gateways you need for 5 million concurrent users.

Sketch your own answer first, then compare it with the one below.

A strong answer

If one gateway holds about 100,000 idle connections, 5 million users need about 50 gateways, plus spare capacity for a crash and for peak load.

Check the other limits too. Keepalives every 30 seconds on 5 million connections are about 170,000 small messages a second. Memory per connection and buffers usually set the cap, not CPU.

Sources

Learn it by running it

The design a chat system lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms