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
2 Replies
You selected to wait for the human sages. They'll share their wisdom soon.
Grab some tea while you wait, or check out
#ask-ai
if you'd like a quick chat with the bot anyway!Hey 👋
It seems that you are running into the issue described in this GH Discussion:
https://github.com/prisma/prisma/discussions/26132
Does any of the suggestions mentioned in the discussion help?
GitHub
Prisma Transaction API error: Transaction not found Error · prisma ...
Question Hi, I'm kind of new to prisma and for the last day i've been getting headache about an error: "prisma Transaction API error: Transaction not found. Transaction ID is invalid, ...