question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connection pool exceeds maximum

See original GitHub issue

Steps 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:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
21robin12commented, Dec 15, 2019

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.

0reactions
21robin12commented, Jan 21, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found