Outpacing OS: Erlang's Scheduler for Millions of Processes

Erlang's VM scheduler manages lightweight processes with ultra-fast context switches (around 20 nanoseconds), far more efficient than OS threads that incur 500-1000 nanoseconds overhead, enabling Erlang to scale to millions of concurrent processes with superior throughput.

The top 3

  1. Erlang's 25x Faster Context Switching Edge Over OS Threads: Erlang processes boast context switching speeds of around 20 nanoseconds, significantly outpacing typical OS threads which can take 500-1000 nanoseconds due to kernel involvement and full CPU state saving.
  2. Erlang Process Memory: Kilobytes vs. Megabytes for OS Threads: Erlang processes are exceptionally lightweight, typically starting at 2-3 KB, allowing millions to run concurrently. In stark contrast, OS threads often consume 1-2 MB of memory each, making them 500-1000 times heavier and limiting concurrency to thousands.
  3. Telecom's Influence: Erlang's Scheduler Built for Unrivaled Fault Tolerance: Erlang's scheduler was born from Ericsson's 1980s need for highly available, fault-tolerant telecom systems. Its design, featuring lightweight, isolated processes and a 'let it crash' philosophy managed by supervision trees, ensures system integrity by localizing failures and preventing cascading outages.

Sources

Open the full topic