N
Neon4mo ago
sensitive-blue

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. Thanks
3 Replies
foreign-sapphire
foreign-sapphire4mo ago
Hey @leofc, are you using the websocket or http transport? How many entries are in salesOrder?
sensitive-blue
sensitive-blueOP4mo 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
foreign-sapphire4mo ago
Awesome, glad to hear!

Did you find this page helpful?