Menu

1 / 2

Thread vs Fiber vs Ractor: I Measured Ruby's Concurrency Model

DEV Community: ruby·Huzaifa Saifuddin·about 22 hours ago
#DdGyfBpl
#devtoruby#devto#dev#resume#take
Reading 0:00
15s threshold

A few weeks back, at RailsConf Pune (Deccan Queen), Shopify engineers gave a talk titled "When Rails Met Fibers: Migrating Sidekiq from Puma to Falcon." Their challenge: an AI chatbot where every request was itself waiting on an external AI API call, and Puma's thread-per-request model was buckling under all that waiting.

I've used Thread for over a decade — Puma's thread pool, Sidekiq workers, the usual. But that talk made me want to go past the surface-level API and actually verify what's happening underneath: what the GVL really guarantees, where Fiber genuinely earns its place, and where Ractor fits in. So I sat down and did exactly that — measuring Thread, Fiber, and Ractor myself instead of taking any of it on faith.

Every number in this post came from a script I ran. The full, runnable repo — one commit per finding — is here: thread-fiber-ractor on GitHub .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.