Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Autoscale your Heroku dynos
Ruby
branch: master

Merge pull request #5 from ndbroadbent/memcached_locking_and_last_scaled

If Rails has Memcached configured, use it to provide global locking and shared last_scaled times
latest commit 979f99d3c7
@ddollar authored

README.md

Heroku::Autoscale

WARNING

This gem is a proof of concept and should not be used in production applications. There is currently no mechanism to prevent multiple dynos on the same app all running this code from fighting each other for control.

Installation

# Gemfile
gem 'heroku-autoscale'

Usage (Rails 2.x)

# config/environment.rb
config.middleware.use Heroku::Autoscale,
  :username  => ENV["HEROKU_USERNAME"],
  :password  => ENV["HEROKU_PASSWORD"],
  :app_name  => ENV["HEROKU_APP_NAME"],
  :min_dynos => 2,
  :max_dynos => 5,
  :queue_wait_low  => 100,  # milliseconds
  :queue_wait_high => 5000, # milliseconds
  :min_frequency   => 10    # seconds

Usage (Rails 3 / Rack)

# config.ru
use Heroku::Autoscale,
  :username  => ENV["HEROKU_USERNAME"],
  :password  => ENV["HEROKU_PASSWORD"],
  :app_name  => ENV["HEROKU_APP_NAME"],
  :min_dynos => 2,
  :max_dynos => 5,
  :queue_wait_low  => 100,  # milliseconds
  :queue_wait_high => 5000, # milliseconds
  :min_frequency   => 10    # seconds
Something went wrong with that request. Please try again.