issue with connection pool ?
See original GitHub issueBug 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:
- Created 2 years ago
- Reactions:2
- Comments:15 (8 by maintainers)
Top GitHub Comments
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
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.