Eyüp Atiş

Auto Scale Heroku Dynos With Hirefire.io

Hirefire.io is a service that auto scales your heroku dynos. It is running both web and worker dynos and scales them according to websites current respond times and non-processed jobs. The setup of this tool is very easy.

If you just want to scale your web dynos you no need to any code changes in your app. You can just sign up to hirefire and make configurations of your website.

If you interested with scaling your worker dynos you must add some codes for counting your non-completed job in the queues. I will explain configuration of Sidekiq gem. You can find more worker gem configurations from here.

Firstly, we must add hirefire-resource gem to our Gemfile

gem "hirefire-resource"

After bundle command, we must configure hirefire for watching our queue.

HireFire::Resource.configure do |config|
  config.dyno(:worker) do
    HireFire::Macro::Sidekiq.queue
  end
end

config.dyno(:worker_dyno_name) must be equal to your worker dyno name in Procfile

When you visit http://localhost:3000/hirefire/development/info you must see something like this:

[{"name": "worker", "quantity": 132}]

When you deploy and configure your account from hirefire you can auto scale your dynos.

This project is maintained by eyupatis