Discord Jozsef Vass Sep 10, 2018

How Discord Handles Two and Half Million Concurrent Voice Users Using WebRTC

Article Summary

Discord handles 2.6 million concurrent voice users with just 850 servers across 13 regions. Here's how they built a custom WebRTC architecture that scales.

Discord's engineering team shares their technical approach to real-time voice and video communication. Written by Staff Engineer Jozsef Vass, this deep dive reveals how they modified WebRTC to serve millions of gamers while keeping IP addresses private and bandwidth costs low.

Key Takeaways

Critical Insight

Discord serves 220 Gbps of voice traffic by customizing WebRTC's lower-level APIs and building specialized infrastructure that prioritizes gaming use cases over standard implementations.

The article reveals why Discord's approach to handling DDoS attacks involves a surprising server reassignment strategy that most users never notice.

About This Article

Problem

Discord needed to handle multiparty voice communication across web, desktop, and mobile without exposing user IP addresses. They also wanted to avoid the high costs of peer-to-peer networking for large group channels that could have up to 1000 concurrent speakers.

Solution

Jozsef Vass's team built a custom C++ media engine on top of WebRTC's native library. They replaced the standard SDP/ICE/DTLS handshakes with minimal 1000-byte exchanges and added Salsa20 encryption with silence suppression to cut bandwidth and CPU usage when no one is talking.

Impact

Discord now handles 2.6 million concurrent voice users across 850 voice servers in 13 regions. The system maintains 220 Gbps of egress traffic and 120 Mpps packet throughput. Their custom SFU bridges native and browser applications by translating between different encryption and transport protocols.