6. One machine concurrent setup
Browser
App Server
Makes request
Rails App
Parses the request Writes response
Sends response
App Server
App Server
App Server
App Server
Pool of workers
7. Many machines concurrent setup
Browser
Makes request Sends response
App Server
App Server
App Server
App Server
App Server
Load Balancer
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
Balances between machines
Instance/VM/Box Instance/VM/Box Instance/VM/Box
8. Slow clients
亰从舒舒 亠 弍舒于仆舒 亶 从舒仂 从舒仆舒仍舒 亠 Internet
仂亢亠 亟舒 亳仄舒 network latency
Browser
App Server
App Server
App Server
App Server
App Server
Load Balancer
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
9. 亰仗仂仍亰于舒亶亠 "弍亠亳" 亰舒 舒亳从舒
Browser
App Server
App Server
App Server
App Server
App Server
ELB/haproxy/nginx
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
App Server
nginxnginx nginx
10. 亰弍亠亠亠 于仆亳仄舒亠仍仆仂 Ruby VM
GC 仄仂亢亠 亟舒 亰舒亠仄舒 ** 于亠仄亠
green threads vs true concurrency vs GIL
仄仆仂亞仂 亰舒于亳亳 仂 仗亳仍仂亢亠仆亳亠仂
ruby 1.8 仆亠 亠 仗仂亟亟亢舒 仂亳亳舒仍仆仂
GC tweaks
RUBY_GC_MALLOC_LIMIT
RUBY_HEAP_SLOTS_INCREMENT
RUBY_HEAP_MIN_SLOTS