# Understanding DB Pooling for Sidekiq Workers

**URL:** <https://meta.discourse.org/t/understanding-db-pooling-for-sidekiq-workers/309891>\
**Category:** Development\
**Created:** [May 29, 2024, 9:10pm UTC](https://meta.discourse.org/t/understanding-db-pooling-for-sidekiq-workers/309891 "2024-05-29T21:10:22Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Mudit\_Maheshwari](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mudit_maheshwari/32/331278_2.png) [@Mudit\_Maheshwari](https://meta.discourse.org/u/Mudit_Maheshwari)\
**Post date:** [May 29, 2024, 9:10pm UTC](https://meta.discourse.org/t/understanding-db-pooling-for-sidekiq-workers/309891/1 "2024-05-29T21:10:22Z")

</div>

Can some please provide clarity on Sidekiq worker database pooling?

Currently, we’ve set `DISCOURSE_DB_POOL` to 15, with 2 Sidekiq workers each having a concurrency of 10. After reading the Sidekiq documentation, it appears that Sidekiq threads share the DB pool, hence I anticipate a maximum of 15 \* 2 = 30 DB connections from Sidekiq workers. However, despite this understanding, we’re observing spikes in DB connections exceeding the expected maximum of 30.

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/4/3/54342793c6cb5540aa4325a1333971ee292950c7.png)

These spikes occur approximately every 15 minutes and seem to be primarily associated with the [PeriodicalUpdates](https://github.com/discourse/discourse/blob/main/app/jobs/scheduled/periodical_updates.rb) scheduled job.

Could anyone kindly provide insights that will help us to avoid these spikes?

---

_[View the full topic](https://meta.discourse.org/t/understanding-db-pooling-for-sidekiq-workers/309891)._
