This document discusses distributed clustering in Ruby. It begins with background on the presenter and then describes typical solutions using multiple processing boxes to scale horizontally. However, this leads to underutilization of resources when load is not evenly distributed. The document proposes a new approach called di-cluster that scales different parts of an application independently based on actual load. It discusses challenges with existing concurrency approaches in Ruby and introduces an early prototype of di-cluster that requires further development and testing.
6. PROBLEMS OF TYPICAL
SOLUTION
you are now available to process 2 times (less in
reality) of your typical load
for 102% load 98% is not utilised
and you scale all parts even ones that dont need to be
scaled
spending money, alcoholism, drugs, depression, life is
over
7. LOOK OUT OF IN THE BOX
Special
processing
box
Your data
Something
useful
in reality is:
Your data
request
processo
r
databas
e
request
business
logic
respons
e
processo
r
Somethin
g
useful
8. SO WHAT?
in reality, your 100% of processing power is:
5% of request processor
20% of database requests
60% of business logic
10% of serialisation
5% of response processor
Load differs from stage to stage.
9. LOOK LIKE I SEE THE IDEA!
What if we will scale only most loaded part of
application?
Typical case: request processor + database +
business logic + serialiser + response * 2 = 200%
This case: request processor + database +
business logic * 2 + serialiser + response = 160%
For 102% of load only 58% is not utilised
11. SIDE STORY OF
CONCURRENCY IN RUBY
Threads
DRuby
Celluloid
concurrent-ruby
Guild model (planned for Ruby 3, author: Koichi
Sasada)
12. THREADS CAVEATS
Some people, when confronted with a problem,
think, "I know, I'll use threads," and then two
they hav erpoblesms.
All multithreading low-level stuff
Aware thread-safety!
Ruby VM is shared/copied to child process
13. LONG STORY SHORT
DRuby is too low-level
Have you seen anyone who uses this in
reality?
concurrent-ruby does not have network
solutions
Guild is not out yet
15. OK, WHATS WRONG WITH
THIS?
you dont know which node runs what
Celluloid. NUFF SAID
No, seriously. Thread per actor is too
expensive
But they gave the idea