I'm not sure exactly how to set up my middleware chain to use the LinearScalingStrategy with DelayedShutdown. Here's what I've got so far, but it only ever scales to 1 worker dyno, even when I add 10+ jobs. Sidekiq's concurrency is set to 1.
# Only auto-scale on Heroku
if ENV['HEROKU_API_KEY'] and ENV['HEROKU_APP']
Sidekiq.configure_client do |config|
config.client_middleware do |chain|
heroku = Autoscaler::HerokuScaler.new
strategy = Autoscaler::DelayedShutdown.new(
Autoscaler::LinearScalingStrategy.new(10, 1),
60
)
Autoscaler::Sidekiq::Client
.add_to_chain(chain, 'default' => heroku)
.set_initial_workers(strategy)
end
end
Sidekiq.configure_server do |config|
config.server_middleware do |chain|
strategy = Autoscaler::DelayedShutdown.new(
Autoscaler::LinearScalingStrategy.new(10, 1),
60
)
chain.add(Autoscaler::Sidekiq::Server, Autoscaler::HerokuScaler, strategy)
end
end
end
I'm not sure exactly how to set up my middleware chain to use the LinearScalingStrategy with DelayedShutdown. Here's what I've got so far, but it only ever scales to 1 worker dyno, even when I add 10+ jobs. Sidekiq's concurrency is set to 1.
What am I doing wrong?