How it works · 45 of 49 Core
How did WhatsApp scale with Erlang and a small team?
Erlang and a very small team
WhatsApp: A messaging app keeps a line open to every phone that is online, so its hard part is millions of open connections at once. WhatsApp wrote its server in Erlang, a language built at Ericsson for telephone switches. Each connection gets its own tiny Erlang process (about 2.6 KB when new) that shares no data with the others; a supervisor restarts only the one that fails. In January 2012 one server held over 2 million connections with 42% of its CPU idle. In February 2014, 450 million people a month used WhatsApp; it had 35 engineers.
Loading the animation…
Say it like this WhatsApp held millions of open connections per server by giving each one its own tiny Erlang process that shares nothing and is restarted alone when it fails, which let 35 engineers serve 450 million people a month.
Under the hood — for builders
- The source, in its words
- WhatsApp Blog, 6 Jan 2012: "we are now able to easily push our systems to over 2 million tcp connections!!" The box showed numopensockets: 2277845, "41.9% idle" CPU, 24 cores, and "the last important piece of our infrastracture is Erlang".
- Terms
- Connection: a line held open so messages arrive at once. Erlang process: a tiny unit of work inside the Erlang runtime, not an operating-system process. Supervisor: a process that restarts its children. one_for_one: restart only the child that failed.
- Why one process per connection is cheap
- Erlang/OTP docs: "A newly spawned Erlang process uses 327 words of memory" (2,616 bytes); processes "share no data". Under one_for_one, "If a child process terminates, only that process is restarted".
- Run here: one bad message, how many people dropped?
- One server, 2,000,000 connections, one day; ~20 crash-causing messages a day. Shared: 200 worker threads of 10,000 connections each. Erlang style: one process each. Rates are ours.
- The team
- Facebook, 19 Feb 2014: "Over 450 million people using the service each month". Wired, Sep 2015 (reporting): "it had 35 engineers and reached more than 450 million users"; about 50 for 900 million.
- Measure it
- Open connections per server · CPU idle at peak · users dropped per crash (should be one) · people served per engineer.
- Watch out
- Few engineers know Erlang (Wired); a process per connection still needs socket buffers and kernel limits raised, as the 2012 box shows. Company writing, first-hand but not independent.
- Sources
- WhatsApp Blog, "1 million is so 2011", 6 Jan 2012 · Facebook Newsroom, "Facebook to Acquire WhatsApp", 19 Feb 2014 · Cade Metz, Wired, Sep 2015 · Erlang/OTP docs, "Processes" and "Supervisor Behaviour" · Rick Reed, Erlang Factory 2014 abstract; all read in session · crash simulation, Python, 19 Nov 2026.
What happens in the WhatsApp's Erlang architecture animation, step by step?
- A messaging app keeps a line open to every phone that is online: millions of open connections at once.
- WhatsApp's server is written in Erlang. Each connection is its own tiny process, about 2.6 KB, sharing nothing. If one crashes, only that one is restarted.
- January 2012: one WhatsApp server held over 2 million connections, with 42% of its CPU still idle.
- Your turn: February 2014, 450 million people a month. How many engineers ran it?
- 35 engineers: about 13 million users each.
- Solve one problem simply, with a tool made for it: Erlang was built for telephone switches. Next: Google Spanner.
What everyday example explains WhatsApp's Erlang architecture?
One switchboard holding millions of lines.
Why should a team care about WhatsApp's Erlang architecture?
Headcount follows complexity, not users. A tool shaped like the problem (a switch for millions of lines) and a small surface kept 35 engineers enough for 450 million people.