Wrapping Up
When you understand how a language’s virtual machine handles memory and performs work, you will write better applications in that language. It’s not a necessity when you first get started, but knowing about Elixir’s scheduler and garbage collector will help your applications be more performant.
Each BEAM process is assigned to a scheduler, which is the part of the VM that gets work done. Elixir uses a multi-scheduler design with work stealing. This is what allows Elixir applications to easily scale across all cores without much effort. Elixir’s scheduler is preemptive—this allows your applications to still handle requests when CPU-heavy work is performed. You can use techniques such as process sharding to avoid single-process bottlenecks ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access