Giter VIP home page Giter VIP logo

hirefire-resource's Introduction

HireFire - The Heroku Dyno Manager

HireFire is a hosted service that manages / autoscales your Heroku dynos.

It supports the following stacks:

  • Celadon Cedar
  • Badious Bamboo
  • Argent Aspen

It supports practically any worker library. We provide out-of-the-box support for:

  • Delayed Job
  • Resque
  • Qu
  • QueueClassic
  • Sidekiq

Note that you can write your own worker queue logic for almost any other worker library as well. HireFire can scale multiple individual worker libraries at the same time, as well as multiple individual queues for any worker library.

It supports practically any Rack-based application or framework, such as:

  • Ruby on Rails
  • Sinatra
  • Padrino
  • Bare Rack Apps

We provide convenient macros for the above mentioned worker libraries to calculate the queue size for each of them. If you wish to conribute more macros for other existing worker libraries feel free to send us a pull request.

Here is an example with Ruby on Rails 3. First, add the gem to your Gemfile:

gem "hirefire-resource"

Then, all you have to do is create an initializer in config/initializers/hirefire.rb and add the following:

HireFire::Resource.configure do |config|
  config.dyno(:resque_worker) do
    HireFire::Macro::Resque.queue
  end

  config.dyno(:dj_worker) do
    HireFire::Macro::Delayed::Job.queue
  end
end

This will allow HireFire to read out the queues for both Resque and Delayed Job. By default these macros will count all the queues combined if you are using multiple different queues for each worker library. You can also pass in specific queues to count, like so:

HireFire::Resource.configure do |config|
  config.dyno(:resque_worker) do
    HireFire::Macro::Resque.queue(:mail, :backup)
  end

  config.dyno(:dj_worker) do
    HireFire::Macro::Delayed::Job.queue(:encode, :compress)
  end
end

This will tell HireFire to count the total amount of jobs from the mail and backup queue for the resque_worker dyno, and the encode and compress queues for the dj_worker dyno. The resque_worker refers to the resque_worker in your Procfile, and the dj_worker refers to the dj_worker in the Procfile. In this case the Procfile would look something like this:

resque_worker: QUEUE=mail,backup bundle exec rake resque:work
dj_worker: QUEUES=encode,compress bundle exec rake jobs:work

Now that HireFire will scale both of the these dyno types based on their individual queue sizes. To customize how they scale, log in to the HireFire web interface.

Visit the official website for more information!

License

hirefire-resource is released under the Apache 2.0 license. See LICENSE.

hirefire-resource's People

Contributors

jc00ke avatar lifmus avatar stewartknapman avatar

Watchers

 avatar

Forkers

workhandsus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.