Hello, does anyone know what could cause this issu...
# orm-help
d
Hello, does anyone know what could cause this issue? I have a server side rendered page in Next.js and a standalone Node.js server which only creates an instance of PrismaClient once (I am not using Next.js's server), I get this error right away when I visit the home page and Next.js makes a call to the standalone API
Copy code
Timed out fetching a new connection from the connection pool. (More info: <http://pris.ly/d/connection-pool>, Current connection limit: 3)
r
@Daniell ๐Ÿ‘‹ I would suggest restarting your database to clear all connections and then setting up Prisma in the following manner so that new connections are not made.
d
Thanks I can try restarting the database, but I am not using Prisma in Next.js, I have a standalone server with a connection that's only made once in the entrypoint file
r
Are you using some kind of hot reloading? That could also cause issues.
d
I double checked but it's not the case, it happens in our master branch of Vercel
r
Is it happening on development or production?
d
It happens in production
The url is next.foodsy.eu if you're interested in checking the network requests, the error shows right away, yet in the backend there is only 1 prisma client initialisation
r
Whereโ€™s your backend hosted?
d
It's hosted on AWS using EC2 blue/green deployment
r
Could you restart the database and increase the connection limit to around 5-8?
Also possibly run
prisma.$disconnect()
on a SIGINT or SIGTERM so when instances are killed, the connection is also closed.
d
I will try
๐Ÿ‘ 1
No success ๐Ÿ˜… Added
Copy code
process.on("SIGTERM", async () => {
  await prisma.$disconnect()
})
And restarted RDS instance, also added
?connection_limit=5
sorry deployment is still in progress, I'll check after
๐Ÿ‘ 1
Thanks it's fixed now!
๐Ÿ™Œ 1