Set AR pool size to the number of Sidekiq threads without adding 2 spare ones
Currently the number of AR threads for Sidekiq is sidekiq threads + 2
. This seems to be based on the upgrade guide for Sidekiq 4. However, this guide says this is necessary for Redis, not for ActiveRecord. For AR it makes no sense to have backup threads as Sidekiq can never use more connections than there are Sidekiq threads. Removing the + 2
would save GitLab.com 200 active connections.