Database connection size should be one plus the concurrency if we are using rails < 5.2 . Here is the corresponding GitHub issue. https://github.com/mperham/sidekiq/issues/4252
If there are 5 threads then the db pool size should be 6 in rails < 5.2 version