From Request To Response And Everything In Between
summary
Follows a real Rails request from load balancer to response, explains how Puma processes (one request per thread) and multithreading interact with the Global VM Lock and why a blocking binding.pry can stall everything. Derives a capacity formula: processes ≈ arrival_rate × average_total_response_time × 4 (25% operating load), and demonstrates with 5 req/s → ~5 processes keeping queues from growing. Calls out per-thread connection pool sizing and database connection limits (example: 20 max connections) as the real scaling constraint.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:03About the talk
- 3:19Requests in a Rails app
- 7:06Single-threaded example
- 9:15Scaling with processes
- 12:30Optimal process count
- 17:25Buffering traffic variability
- 21:44Multi-threaded design
- 25:46Global VM lock limits
- 29:14Database connection pooling
- 33:32Request to response
- 35:41Closing notes
related talks
32mLook Ma, No Sidekiq: A peek into async future
27mInside Rails: The Lifecycle of a Response
41mIn The Loop
56mRails 4 and the Future of Web
41mRequest and Response
38mA Practical Look at Performance Theory
26mRails Performance Monitoring 101: A Primer for Developers
30mRails Performance monitoring: A primer for developers
