hey guys my prisma api calls sometimes timeout aft...
# orm-help
p
hey guys my prisma api calls sometimes timeout after 30s - i guess it's because of my connection pooler being overloaded and the waiting queue ist too long causing the timeout. i'm using supabase with pgbouncer hosted on vercel do you have any idea how to solve this?
r
@Phil Bookst 👋 That’s possible yes, @janpio do you have any idea about this one?
j
What does "timeout" mean? Are you getting a specific error message?
What kind of "prisma api calls" are you doing? Normal queries?
p
yes i'm doing normal queries, almost purely nested writes/reads. With timeouts i mean serverless execution timeouts. my db write queries can take up to 6s sometimes is this normal? i guess it's because i'm having many concurrent requests and supabase allows a pgbouncer with a mere pool size of 15, my queries get queued up and sometimes wont be able to execute if the queue gets too long? i've pushed my execution limit up to 60s now the errors have reduced drastically but still losing some db entries on the way is rather inaccaptable i thought about using the supabases rpc() call to stored procedures, since these are http based and better suited for serverless environments until their client library supports nested writes - but then i wouldn't be able to use the beauty of prismas queries 😞
is there a way to extract the queries prisma does and put them into these stored procedures/functions?
j
Not if you want to use Prisma in any way.
If you just want Prisma create the SQL once, then put that into something database side, that could work: pris.ly/d/logging and pris.ly/d/debugging should give you the generated SQL queries. (Often it is multiple ones though depending on each other)