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.

issue with connection pool ?

See original GitHub issue

Bug description

Hello,

I’m trying to diagnose a connection pool problem we have in production. The DB is a timescaleDB, but viewed from Prisma, it’s simply a postgresql. (The DB is hosted at a DBaaS provider, and we don’t have as much logs and diag as we would like unfortunately).

The symptom is the following: after a few hours of uptime, we start to see these errors growing:

Timed out fetching a new connection from the pool. Please consider reducing the number of requests or increasing the `connection_limit` parameter (...). Current limit: 25, amount of connections currently in use: 16.

First, I don’t see why there’s a timeout fetching a connection, since the max is not reached. And then the connection pool seems already pretty oversized to me: 600 query/mn, ~500ms per query in avg, and we have 2 parallel instances. So 25 should be plenty.

The problem just worsen and worsen until we reboot the service, and everything goes back to normal.

It looks like some connections are not re-used, as if they were waiting for the server or something. What can I do, application-side, to better diagnose the problem ?

How to reproduce

No response

Expected behavior

No response

Prisma information

not query specific

Environment & setup

  • docker based, 2 containers running in AWS ECS Fargate.
  • timescaleDB (postgresql 12.7)
  • Node.js 12.13

Prisma Version

@prisma/cli          : 2.15.0
@prisma/client       : 2.15.0
Current platform     : debian-openssl-1.1.x
Query Engine         : query-engine e51dc3b5a9ee790a07104bec1c9477d51740fe54 (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine     : migration-engine-cli e51dc3b5a9ee790a07104bec1c9477d51740fe54 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core e51dc3b5a9ee790a07104bec1c9477d51740fe54 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary        : prisma-fmt e51dc3b5a9ee790a07104bec1c9477d51740fe54 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Studio               : 0.340.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
garrensmithcommented, Apr 1, 2022

This is fixed. The full information can be found here https://github.com/importcjj/mobc/issues/63 This will be out in the next release. You can test it now with prisma@dev

2reactions
Syttencommented, Jun 14, 2021

You have a very old version of prisma, if you search for issues on the pool many have been fixed since then. You can check https://github.com/prisma/prisma/issues/6329#issuecomment-811097812 for more details. I suggest you update prisma first and try again to reproduce.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connection pool issue - java - Stack Overflow
In this case Apache DBCP is the connection pool hanging on to the connection, but you do NOT want DBCP to close the...
Read more >
Troubleshooting connection pooling (J2C) problems in ... - IBM
2. This situation would occur when the connection pool is at its maximum size (defined by the Maximum Connections property on the connection ......
Read more >
What is connection pooling, and why should you care
Database connection pooling is a way to reduce the cost of opening and closing connections by maintaining a “pool” of open connections that...
Read more >
Improve database performance with connection pooling
We can resolve this problem by pooling connections from clients. Instead of creating a new connection with every request, connection poolers ...
Read more >
Connection Pool Issue - Oracle Communities
We are having issues with our ORDS environment where one long running service (query) is causing the connection pool to fill up.
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