What is the difference between the way Ruby and Erlang processes are scheduled? I explore the differences in latency and where this can lead to issues in industries like payments.
8. Scheduling: Erlang (BEAM)
Preemptive Scheduling
Runs 2000 reductions and then processes the next task
“In computing, preemption is the act of temporarily interrupting a task being carried out by a computer system,
without requiring its cooperation, and with the intention of resuming the task at a later time. Such a change is known as
a context switch. It is normally carried out by a privileged task or part of the system known as a preemptive scheduler,
which has the power to preempt, or interrupt, and later resume, other tasks in the system.” https://en.wikipedia.
org/wiki/Preemption_(computing)
Light weight processes
Runs each process as a thread, allowing for a plethora of processes.
9. Scheduling: Ruby (YARV)
One Thread per Process
passenger_thread_count “The default value is 1.”
This value can be increased in the Enterprise version
Most Ruby servers are running one thread per process
10. Conclusions
Ruby requires horizontal scaling
Ruby requires tuning
Erlang can handle scaling
Erlang handles these problems by default
Payment providers with a fixed amount of cores should use Erlang