Merge branch 'remove-sidekiq-backup-ar-threads' into 'master'

Don't use backup AR connections for Sidekiq

Closes #27713

See merge request !9001
This commit is contained in:
Douwe Maan 2017-02-06 19:24:46 +00:00
commit c25ac43276
2 changed files with 5 additions and 3 deletions

View file

@ -0,0 +1,4 @@
---
title: Don't use backup Active Record connections for Sidekiq
merge_request:
author:

View file

@ -36,11 +36,9 @@ Sidekiq.configure_server do |config|
Gitlab::SidekiqThrottler.execute!
# Database pool should be at least `sidekiq_concurrency` + 2
# For more info, see: https://github.com/mperham/sidekiq/blob/master/4.0-Upgrade.md
config = ActiveRecord::Base.configurations[Rails.env] ||
Rails.application.config.database_configuration[Rails.env]
config['pool'] = Sidekiq.options[:concurrency] + 2
config['pool'] = Sidekiq.options[:concurrency]
ActiveRecord::Base.establish_connection(config)
Rails.logger.debug("Connection Pool size for Sidekiq Server is now: #{ActiveRecord::Base.connection.pool.instance_variable_get('@size')}")