P
Prisma13mo ago
Luxaritas

How does Priama handle connection cleanup in the connection pool?

I'm currently looking into the possibility of moving our database to Aurora to take advantage of autoscaled DB capacity. However, I'm imagining there could be potential issues depending on how Prisma handles its connection pool. Specifically: 1) Does Prisma ever close or "refresh" idle connections once established? If it keeps them live forever, I can imagine this could prevent instance scale-in from happening, at least in a reasonable timespan, as eg a read replica would still have connections that its waiting to be terminated (or in the case of serverless v2, there may be more idle connections than can be supported with the allocated compute capacity can support) 2) What happens if the DB itself closes the idle connections, eg if I lowered wait_timeout? Would it just remove the connection from the pool and establish a new connection if needed? If I'm reading the engines source correctly, it appears that there is both a default max lifetime (which may be configurable via an undocumented connection url query parameter?) as well as a periodic health check? Looking at the metrics for my current staging DB instance it doesn't seem to be releasing connections though, even though it gets barely any traffic
2 Replies
cesar sampaio
cesar sampaio4w ago
did u ever figured out the answer? @Luxaritas
Luxaritas
Luxaritas4w ago
Never got any further info, no
Want results from more Discord servers?
Add your server