Discord significantly reduced its websocket traffic by almost 40% through a series of compression optimizations, including switching from zlib to zstandard with streaming compression and introducing a new passive session update method. Initially, tests showed zstandard underperforming due to the lack of streaming support. After adding streaming and fine-tuning compression parameters, zstandard outperformed zlib. Additionally, switching from sending full updates to delta updates for passive sessions further reduced bandwidth usage.

15m read timeFrom discord.com
Post cover image
Table of contents
TuningZstandard DictionariesBuffer UpgradingImplementation and Rollout

Sort: