Connection Pooling issues with Azure SQL
I continue to see issues in our error logs in production with prisma using Azure SQL:
The connection string looks like this:
This is in a nextjs app that we are using it.
6 Replies
Hi @Jonathan 👋
Apologies for the late response here. This must have slipped through the cracks. Can you increase the
connectionLimit
parameter from the default of 3 to say 20?Microsoft SQL Server | Prisma Documentation
This page explains how Prisma can connect to a Microsoft SQL Server database using the Microsoft SQL Server database connector.
ok I will give it a try
Do let us know if increasing it solves the issue for for you.
ok thanks
Hey,
You've actually opened up a lot of connections. This can lead to further problems. I wouldn't increase the limit but consider using a kind of "lib" for this.
I would build something like that:
"lib/prisma.js"
I would then remove the dependencies from Prisma and only use the Lib.
Then you only have one connection (usually enough, unless you have a social media site, but then you need other things anyway)
example:
Yeah I have a few thousand active users at a time generally and I am doing something like this in the nextjs app