Connection pool exceeds maximum
See original GitHub issueSteps to reproduce
No idea unfortunately - this is an intermittent issue.
The issue
- Web API connects to Postgres DB using Npgsql. This application performs a simple DB read operation of a few thousand rows which usually takes ~250ms
- Very occasionally, the application hangs while awaiting the asynchronous DB read. I’ve seen this hang for up to 300s - despite this delay, the call does complete successfully and the API returns HTTP 200
- Connection pool is limited to a maximum of 6 in the connection string
- I’ve observed 7 connections from a single client from looking at
pg_stat_activity
. It seems like this coincides with the issue described above - when the application hangs on a DB read, the connection pool maximum has been exceeded
Further technical details
Npgsql version: 4.0.10 PostgreSQL version: PostgreSQL 9.6.15, compiled by Visual C++ build 1800, 64-bit Operating system: web API is running inside Docker container, running Debian GNU/Linux 9. Postgres DB is Azure managed database
Any idea what’s going on here?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Downside of large "max connections" in a connection pool ...
The default max pool size is 100 and one should generally stick with that unless there are special requirements. Setting the max connection ......
Read more >spring boot - Does max connection pool also limits ...
It shows max 300 which is equal to the pool size.It never increases than max pool.Is this intened? I thought pool size means...
Read more >Connection Pool limit exceeds Error
Basically, This error occurs whenever connection pool limit exceeds.This can be resolved by clearing connection pool.
Read more >Connection pool settings
If Maximum Connections is set to 0, an infinite number of physical connections are enabled, and the Connection timeout value is ignored. Information,...
Read more >Java Web Application fails: exceeding maximum connections ...
This error happens when your application exceeds the maximum number of connections allowed by your database provider. This prevents further connections from ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Since upgrading we haven’t seen this issue, so I’m hoping it’s fixed. Not 100% sure since it was such an intermittent problem, sometimes a couple of weeks between occurrences.
We haven’t seen this issue since upgrading 2 months ago (21st November) so I’m fairly confident this is resolved. Thanks for your help @roji @NinoFloris