Multiprocessing is the most efficient way to serve Rails apps
summary
Claim: multiprocessing (Unicorn/Pitchfork/Passenger single-threaded processes) gives more predictable latency, easier memory-leak handling and safer timeouts than thread- or fiber-first servers (Puma/Falcon). Evidence: large shops (Shopify, GitHub, Zendesk, Intercom) run process models; Datadog profiling shows only 16% of apps spend <40% CPU per request and 3% <20%; Ruby 3.2 adds a GVL contention API and Rails-scale use of OBGC controlled major GCs cuts P99 GC pauses from seconds to milliseconds, making process isolation practical and operable.
AI-written summary · about
chapters (11)
- 0:00Introduction and hot take
- 4:49Ruby server trends and assumptions
- 13:32Operability in web services
- 14:49Rails apps are not purely I/O bound
- 15:32Global VM Lock and contention
- 21:29Ruby garbage collector impact
- 26:56Handling stuck requests
- 29:29Memory limits and leaks
- 31:00Memory usage in multiprocessing
- 34:01When to use threads or fibers
- 35:11Conclusion and final thoughts
