Generally this seems to work fine but randomly I sometimes get the error “Timed out fetching a new connection from the connection pool. More info: Connection pool | Prisma Documentation (Current connection pool timeout: 10, connection limit: 5)” from Prisma.
When using another database provider I don’t see those problems and there’s next to no load on that website so it shouldn’t reach any connection limits. I tried customizing the connection string to change timeouts or limits but that doesn’t seem to work.
What’s the issue with the connection here? Do I have some wrong settings?
Hey @vantezzen, thanks or reporting this issue. I was able to reproduce the problem. In my testing it occurs when Vercel Postgres goes from idle to active state. By default Vercel Postgres scales to zero after 5 minutes of inactivity. When it gets woken up is when the timeout occurs.
However, this only happens with Prisma so there is some kind of issue there. I reported the problem upstream so we can find a long-term solution.
In the meantime you can try these workarounds
Option A:
If you don’t have much load anyway you can try using the non-pooled direct connection