~learn.
0:00 / 1:07
W06 · Real-time channels

Memory says 13 servers. You need 75.

transcript

10 million live connections. How many servers do you need? Memory says 13. You need 75.

50 million users. 15 percent online at peak, some on two devices. About 10 million sockets. Assume 40 kilobytes each. About 400 gigabytes. Half of each 64 gigabyte server holds sockets. That's 13 servers.

But here's the catch. Servers die. Whole zones die. Lose one, and 3.3 million sockets reconnect.

The 50 survivors admit about 50,000 a second. If everyone retries within the same second? That's 66 times over.

So cap each server at 200,000 sockets. One crash now hits just 2 percent. Three zones, and survive losing one. That's 75 servers, not 13.

And traffic? Every phone pings every 30 seconds. 333,000 heartbeats a second. Notifications at peak? About 1,700 a second.

Heartbeats outnumber notifications over 100 to 1. Messages were never the problem. So size by connections and reconnects. Not messages.

Full breakdown in the lecture.