Permalink
Browse files

Trying out autoscaling sidekiq workers.

  • Loading branch information...
1 parent 2414a61 commit eba35e06fa576050eca56865ac0641bf9712a5bb @thegreatape committed Nov 5, 2012
Showing with 15 additions and 0 deletions.
  1. +1 −0 Procfile
  2. +14 −0 config/initializers/sidekiq.rb
View
@@ -1 +1,2 @@
web: bundle exec rails server thin -p $PORT -e $RACK_ENV
+worker: bundle exec sidekiq
@@ -0,0 +1,14 @@
+require 'autoscaler/sidekiq'
+require 'autoscaler/heroku_scaler'
+
+Sidekiq.configure_client do |config|
+ config.client_middleware do |chain|
+ chain.add Autoscaler::Sidekiq::Client, 'default' => Autoscaler::HerokuScaler.new
+ end
+end
+
+Sidekiq.configure_server do |config|
+ config.server_middleware do |chain|
+ chain.add(Autoscaler::Sidekiq::Server, Autoscaler::HerokuScaler.new, 60)
+ end
+end

0 comments on commit eba35e0

Please sign in to comment.