Rage Under the Hood: Breaking Rack and Embracing Fibers
summary
A fiber-first Ruby framework called Rage swaps generic adapters for purpose-built components: a custom server that implements Rack but enables direct inter-process broadcasts, an in-process queue called Rage Deferred with an on-disk writer headlock, and a fiber-native ActiveRecord connection pool that returns connections during waits. It leverages the Ruby Fiber Scheduler to make blocking I/O feel synchronous, hits 5,000 concurrent SSE streams while still serving 11,000 RPS, and reports a 2.6x throughput gain on a CPU-bound real-world API.
AI-written summary · about
chapters (14)
- 0:00Ruby’s growth challenge
- 1:16Introducing Rage framework
- 3:08Opaque vs transparent complexity
- 6:09ActiveJob vs Rage Deferred
- 8:22Database connection pinning
- 10:38Rack limitations and solutions
- 13:15Single-threaded concurrency
- 18:36Fibers and event loop
- 20:29Concurrent requests in one thread
- 20:54Fiber trade-offs and processes
- 22:26Tailored connection pool
- 24:21Load test results
- 26:15Simpler and faster architecture
- 26:35Ruby’s future and tools
