# Sudden spike in the number of db connections after Hangfire Server starts

**URL:** <https://discuss.hangfire.io/t/sudden-spike-in-the-number-of-db-connections-after-hangfire-server-starts/7714>\
**Category:** question\
**Tags:** postgres, dotnetcore\
**Created:** [August 24, 2020, 6:26pm UTC](https://discuss.hangfire.io/t/sudden-spike-in-the-number-of-db-connections-after-hangfire-server-starts/7714 "2020-08-24T18:26:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sai\_Teja\_Singamsetty](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/sai_teja_singamsetty/32/1772_2.png) [@Sai\_Teja\_Singamsetty](https://discuss.hangfire.io/u/Sai_Teja_Singamsetty)\
**Post date:** [August 24, 2020, 6:26pm UTC](https://discuss.hangfire.io/t/sudden-spike-in-the-number-of-db-connections-after-hangfire-server-starts/7714/1 "2020-08-24T18:26:00Z")

</div>

I have seperated my logic to Hangfire client which will add jobs to databases, Hangfire server which will pick and execute the job (through hangfire’s internal polling).

When I just started Hangfire client in environment, I could see 2-3 postgresql connections established. But when I started Hangfire server with WorkerCount as 3, the connections immediately raised to nearly 40. All those connections are idle.

I have enabled pooling anyways but what is causing server to create so many connections very immediately as it starts. Are we missing anything or is this expected?  
Workercount with 1 also created 32 connections approx.

“Hangfire” Version=“1.7.12”  
“Hangfire.PostgreSql” Version=“1.7.1”  
“Hangfire.AspNetCore” Version=“1.7.12”  
“Npgsql.EntityFrameworkCore.PostgreSQL” Version=“3.1.4”

Please suggest…
