🚀Kino Speeds Up Ruby Apps With Ractors
Ruby apps get a major speed boost with Kino and Ractors
TL;DR
Kino, a new Ruby server, uses Ractors to run code in parallel, boosting performance by up to 5x compared to traditional methods. Perfect for those looking to squeeze more out of their servers.
Kino is shaking things up with its innovative use of Ractors to run Ruby code in parallel on all cores without the need for multiple processes or threads. This approach slashes overhead and boosts performance by as much as 5x compared to traditional methods like Puma fork clusters, especially on I/O-light endpoints where Kino's :ractor mode outperforms by 30%+. If you're running a Ruby app that could benefit from reduced latency and better CPU utilization, Kino might be your new best friend. Benchmarks show significant gains across the board, with real-world apps seeing up to 2x faster performance.
Key Points
Benchmarks show Kino's :ractor mode runs the Rack app 5× faster than its own GVL-bound threaded mode on an AWS c7a.2xlarge server (8-core AMD EPYC 9R14, 64 GB RAM).
Kino's :threaded fallback mode is solid but Ractors are officially experimental in Ruby 4.0; Kino aims to be the best way to experiment with Ractors today.
On a real Rails app (not Ractor-shareable), Kino's :threaded fallback runs everything else including Rails, offering significant performance improvements over traditional methods.
Kino slots are threads, not processes—when your app waits a lot, raise workers; this tuning can add +25% over the cluster on /io while still ahead of it on pure CPU in one small process.
To use Kino, you need Ruby >= 4.0 and can install it via `bundle add kino` or `gem install kino`. Generate a config with `bundle exec kino --init`.
Why It Matters
If you're running a Rack app on Puma, switching to Kino's :ractor mode could cut your response times by up to 50%. For real-world Rails apps, the performance gains are still significant but depend more on how much waiting your app does. Smaller databases or less CPU-intensive workloads might not see as big a boost.
Frequently Asked Questions
Why does this matter?
If you're running a Rack app on Puma, switching to Kino's :ractor mode could cut your response times by up to 50%. For real-world Rails apps, the performance gains are still significant but depend more on how much waiting your app does. Smaller databases or less CPU-intensive workloads might not see as big a boost.
What happened?
Kino, a new Ruby server, uses Ractors to run code in parallel, boosting performance by up to 5x compared to traditional methods. Perfect for those looking to squeeze more out of their servers.
Comments
Be the first to comment
Enjoyed this article?
Get it daily. 7am. Free. Reads in 5 minutes.
Join 3,304 builders reading daily.