Hello. I know this question has been answered, but...
# orm-help
i
Hello. I know this question has been answered, but I think my usecase is different and I haven't found any relevant answer. I have nextjs application, prisma client instance is created based on the doc. I have DataProxy and .env config set up to use dataproxy and generated
prisma://..
connection string. The underlaying database is Heroku Hoby basic plan (20 connections). Everything should be ready to serverless environment but I keep receiving this error: Error: Invalid prisma.nearDailyStats.findFirst() invocation: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3) (edited) [4:35 PM] any idea what's the problem? Thank you
j
All the time or only on some requests?
i
aprox 75% fails and 25% ok
I think it the problem would be Vercel serverless function timeout. It means that prisma dataproxy or heroku connection is slow and dont return data within 10 sec. Underlaying datatable has about 40 k rows so it should not be problem
j
If you are still getting the
Timed out fetching a new connection from the connection pool....
error message it means Prisma Client did return, and the serverless function did not get terminated.
Can you reproduce this easily? Can you share a reproduction with us?
i
It happened in the production environment so it is difficult to reproduce. I hope I've solved the problem by migrating from prisma dataproxy and heroku to digitalocean db and its pgBouncer connections pool.
j
PgBouncer definitely is an alterantive when configured correctly and according to your request patterns etc.