2 million players online. The matchmaking queue is 2.4 MB.
transcript
2 million players online at once. The entire matchmaking queue fits in 2.4 megabytes. So why is this hard?
Of 2 million players, about 1.6 million are in matches. About 360,000 are in menus, lobbies and post-game screens. And in the queue? About 40,000. Just 2 percent.
Where does 40,000 come from? Little's law. About 1,300 players get matched every second. Each waits about 30 seconds. 1,300 times 30. About 40,000 in the queue at any moment.
About 60 bytes per queued player. Times 40,000. 2.4 megabytes. The whole queue. Even at peak, about 4,000 joins a second. Small numbers.
But here's the catch. Two matchmakers both think they're the leader. Both read the same 10 players. Both create a match. Double-booked. So one leader per region, elected through etcd. And every queue change carries its fencing token. A zombie leader is rejected.
Shard the queue by region? Not for memory. For locality, and isolation. The difficulty isn't throughput. It's coordination.
Full breakdown in the lecture.