Getting Connection closed. randomly
We have been using Vercel/Next.js/Prisma for a bit and in one specific spot we have
prisma.salesOrder.findMany() including a bunch of other tables (not ideal I know).
When we use order by in this operation, we get "Connection closed.". Things I have done so far:
- Changing the connection string from connect_timeout=15&connection_limit=20&pool_timeout=60 to connect_timeout=60&connection_limit=30&pool_timeout=0
- Decreased the QUERY_BATCH_SIZE from 1000 to 500
Even after that, I see the requests end after 13.something seconds (always less than 14s). I don't have any hard limit in Vercel with 14s, so trying to understand why the variables above are not working or what I can do. Thanks3 Replies
foreign-sapphire•4mo ago
Hey @leofc, are you using the websocket or http transport? How many entries are in
salesOrder?sensitive-blueOP•4mo ago
http transport. I was able to figure out, it was hitting the 15s limit in Vercel, enabled fluid compute and it worked. Thanks!
foreign-sapphire•4mo ago
Awesome, glad to hear!