Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Erlang vs Ruby SOA Scheduling

584 views

Published on

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.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Erlang vs Ruby SOA Scheduling

  1. 1. Erlang vs Ruby Preemptive Scheduling
  2. 2. Ruby Virtual Machine: YARV Application Server: Phusion Passenger Web Server: Nginx Server: Digital Ocean 2 cores and 2 GB RAM
  3. 3. Erlang Virtual Machine: BEAM Web Server: Cowboy Server: Digital Ocean 2 cores and 2 GB RAM
  4. 4. Basic Architecture Server Apache Benchmark HTTP AUTH Hello, Alladin! 5’ Processing
  5. 5. SOA Architecture Ruby Server Apache Benchmark HTTP AUTH Hello, Alladin! Ruby Service Req Resp
  6. 6. 50 concurrent requests Erlang Ruby ab -n 50 -c 50 -A “username:password” <server>
  7. 7. Discussion Erlang response time approx. constant Ruby response time increasing (~900 ms / req)
  8. 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. 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. 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
  11. 11. Thank you Markus Feyh markus.feyh@gmail.com

×