We had an issue recently in production, where the ...
# orm-help
j
We had an issue recently in production, where the connection of prisma seemed to be “down”. We had a burst of activity (50 database connections fired in a split second, leading to this problem, and basically breaking our production app):
Copy code
Object { message: "Timed out fetching a new connection from the connection pool. (More info: <http://pris.ly/d/connection-pool>, Current connection limit: 5)", locations: […], path: […], … } -
I had to redeploy the container we had our API deployed on to fix this (the database connection stayed down until then). Obviously something is going wrong with our connections on prisma, but I can’t tell since we only have a single
prisma client
we init in a module. Any potential ways of troubleshooting this? Should I do the ill-advised
prisma.$disconnect
?
r
@Jonathan 👋 Would it be possible for you to create a sample reproduction of this and file it here as an issue? @janpio is there anything else that can be done to investigate this?
j
Will try to do this asap
🙌 1
j
What I usually advise is to get a full overview of the open connections from Prisma and the database - to be able to understand where things could hang.
j
Ah, what method do you use to get this overview?
j
That is a really good question - and unfortunately depends on your setup, hosting and so on. Often there is a graph in some monitoring UI that shows that, or you can send a few queries to the database to get that information.
Fundamentally you need to understand waht is going on in the database and application at the time things go wrong.
Very often it is a restart of something, something hanging or being blocked, or similar that then triggers a cascade of bad things the system does not recover from by itself.
j
Gotcha, thanks for the clarification @janpio :). In case you by any chance have any techniques you know of for say, a postgres at RDS, or a good tool for such things, Id be open for the tips. Im gonna look around in the blogsphere for some articles to help the observabity here
j
RDS has a bunch of graphs out of the box and you can enable more in the settings usually. That can give you some insight what is happening on the database side. DBeaver is an open source GUI that can display some numbers and open connections as well.
🙌 1
j
@Daan Helsloot