I have a follow-up question to something I asked e...
# orm-help
j
I have a follow-up question to something I asked earlier here. In a monolith app (let’s say, a single docker container), that is always-on, is it common to always have at least one or two connections running. I would assume that if no users are using the application, the nr of connections should go to 0? But we have always at least 2 connections (even In a test environment where no users are using it), and it never goes to 0. Does that suggest that prisma is somehow not disconnecting, and has some sort of “disconnect leak”?
From some further reading, I think these two connectons are part of the connection pool that prisma sets up (and does not disconnect). For new connections, these connections are thus used (and if more connections are required, a new conneciton in the pool is created, and I assumed closed afterwards).
@Daan Helsloot
j
As long as Prisma is running (Which it usually is after being used once, and the server that did so is still running) it will also keep some connections open. You can configure your database to close these after x time of idle.
You can call
prisma.$disconnect()
to close all connections instantly - but that means that the next query that is executed will need to recreate a connection again which takes time.