This add-on is operated by Adamlogic, LLC
Advanced autoscaling for your Rails web and worker dynos
Last updated September 04, 2023
Table of Contents
Rails Autoscale is an add-on that automatically scales web and worker dynos for Rails applications. This improves app performance while drastically reducing your Heroku bill.
Autoscaling ensures that your app can gracefully handle increased traffic while only paying for the dynos you need.
This documentation page is a high-level summary. See the official documentation site for more.
How is Rails Autoscale different from Judoscale?
It’s not! Rails Autoscale and Judoscale are the same product, which is why you’ll see “Judoscale” in the UI when you launch Rails Autoscale.
Does that mean you should switch from Rails Autoscale to Judoscale? Nope! It’s just another “face” of Judoscale in the add-on marketplace, but it works exactly the same.
If you’re still deciding which one to use, we (ever so gently) recommend using Judoscale just so the branding you see in the app matches what you see in your Heroku add-on list. But don’t stress over it. They are the same product, with the same pricing, supported by the same team. And they’re the best autoscaler out there.
How is Rails Autoscale different from Heroku’s built-in autoscaler?
Heroku offers a native autoscaling solution for customers using performance dynos. It only autoscales web dynos, and it uses response time as the metric to trigger scaling. Rails Autoscale is different in a few ways:
- You can autoscale standard, performance, private, and shield dynos.
- You can autoscale both web dynos and worker dynos (Sidekiq, Resque, Delayed Job, and Que).
- Your web dynos autoscale based on request queue time instead of response time. Queue time is a true capacity metric, unaffected by application performance like response time.
- Our web UI offers beautiful visualizations showing how your traffic impacts scaling.
- You control how quickly you scale up (optionally jumping by multiple dynos) and scale down.
Rails Autoscale can be installed from the Heroku Elements marketplace or the via CLI:
Check out Rails Autoscale on Heroku Elements for pricing and plans.
$ heroku addons:create rails-autoscale -----> Adding RAILS_AUTOSCALE_URL to sharp-mountain-4005... done, v18 (free)
Launch Rails Autoscale in your browser to complete the installation:
$ heroku addons:open rails-autoscale
The app will walk you through installing the adapter gems which are responsible for reporting your capacity metrics.
Rails Autoscale supports Rails 3.2+ and Ruby 1.9.3+.
Once the gem(s) are installed and your app is deployed, you’ll begin to see activity in your Rails Autoscale charts. Autoscaling is disabled by default, though, so you’ll need to turn it on using the toggle in the upper right corner.
Request queue time threshold
Rails Autoscale triggers scale events by monitoring the request queue time for every request. This is the time between Heroku accepting a request and your application beginning processing. Queue time will increase when your application servers are too busy to handle all incoming requests.
For a complete explanation of request queue time, check out “What is request queue time, and why is it so important?”
Rails Autoscale will autoscale worker dynos that are using Sidekiq, Resque, Delayed Job, or Que. It’s as easy as autoscaling your web dynos—but in this case, we work with job queue time instead of request queue time.
Job queue time is how long jobs are waiting in a queue before being processed. Sidekiq call this metric “queue latency”. Rails Autoscale measures job queue time per queue, and you select which queues you want to use for autoscaling.
Plans & pricing
Our Heroku pricing breaks down into tiers based on the type of dyno your app runs (standard or perf/private/shield) and the maximum number of dynos you need to run at any given time. The “max dynos” limit is enforced when setting your dyno range within the app:
Migrating between plans
heroku addons:upgrade command to migrate to a new plan.
$ heroku addons:upgrade rails-autoscale:newplan -----> Upgrading rails-autoscale:newplan to sharp-mountain-4005... done, v18 ($49/mo) Your plan has been updated to: rails-autoscale:newplan
Removing the add-on
Rails Autoscale can be removed via the CLI.
This will destroy all associated data and cannot be undone!
$ heroku addons:destroy rails-autoscale -----> Removing rails-autoscale from sharp-mountain-4005... done, v20 (free)