NPGSQL connection pool issue

1.7k Views Asked by At

we are planning to migrate from EDB PostgreSQL to the community PostgreSQL. So we have started using the NPGSQL library instead EDB library. we configured the same connection string settings as what we have in EDB connection strings.

<add name="ConnectionString" 
connectionString="Host='XXXXX';port=9999;username='XXXX';password='XXXX';Database='dev_xxxx';Timeout=300;**ConnectionLifetime=2;MinPoolSize=5;MaxPoolSize=25;**CommandTimeout=300;" />
<add name="NPGSQLConnectionString" 
connectionString="Host='XXXX';port=9999;username='XXXX';password='XXXX';Database='dev_xxxx';Timeout=300;Connection Idle Lifetime=300;Connection Pruning Interval = 10;**MinPoolSize=5;MaxPoolSize=25;**CommandTimeout=300;**ConnectionLifetime=2;**" />

but when I change to use NPGSQL library, we are getting the below issues.

Npgsql.NpgsqlException (0x80004005): The connection pool has been exhausted, either raise MaxPoolSize (currently 25) or Timeout (currently 300 seconds) ---> System.TimeoutException: The operation has timed out.

I understand, I have to increase the max pool size, but the same configuration is working in EDB ?

I tried to increase maxpool size to 50, but it makes no difference. so I'm expecting a connection leak, but have no way to test or monitor it.

Npgsql version: 5.0.1.1 PostgreSQL version: 9.5

0

There are 0 best solutions below