No matter what I try, I can't seem to get Sidekiq to honour my max pool size settings. I've tried:
- setting pool in my database:
production:
adapter: mysql2
encoding: utf8
database: database
username: username
password: password
host: host
reconnect: true
pool: 10
- hard-coding it in my sidekiq initializer (both with and without the disconnect! and both inside and outside the configure server block):
Sidekiq.configure_server do |config|
ActiveRecord::Base.connection.disconnect!
ActiveRecord::Base.configurations['production']['pool'] = 50
ActiveRecord::Base.establish_connection
end
- setting it using a DATABASE_URL env var (and yes, I made sure DATABASE_URL was set, using https://github.com/glenngillen/rails-database-url):
database_url = ENV['DATABASE_URL']
if(database_url)
ENV['DATABASE_URL'] = "#{database_url}?pool=25"
ActiveRecord::Base.establish_connection
end
I have no idea why none of these have worked. Any ideas?
In case it's relevant:
- rails 3.2.12
- sidekiq 2.6.4