guizin
PPrisma
•Created by guizin on 2/10/2025 in #help-and-questions
How to properly deal with connections pool and disconnects
Hi everyone! At the company that I work, we were facing a problem where too many Prisma connections were making our database slow down considerably, freezing our entire system, we them added a bunch of disconnects after some important and long queries (this is a production env) , the problem was solved, at peak we had 5k connections and now we are sitting at 600ish
Now some important parts of our system are throwing the following error: Transaction ID is invalid, refers to an old closed transaction Prisma does not have information about it anymore, or was obtained before disconnecting.
We thought that maybe we were disconnecting too much, and possibly affecting ongoing transactions, we are trying to narrow down removing some disconnects, but we fear that our problem with the DB (Postgresql) happens again. I would be glad if someone could provide some guidance, what should be investigated, and possible solutions
3 replies