Hi There!
I have a remix application running on vercel, which uses prisma to connect to a postgres DB on supabase. We use supabase’s transactional mode and pooler and set max_connections=1&pgbouncer=true
in our prisma connection string.
We recently had a couple of spikes in requests that let to the supabase returning “FATAL Max connection limit reached” errors. This is all perfectly understandable and we need to scale up our instance a little and look at connection usage.
However, when this happened our application because unavailable/unresponsive on vercel even when timeout has lapsed and we’d expect the DB to be accepting connections again. The only way to restart things were to redeploy the application, which fixed thins immedately.
I am trying to understand why this. would be the case and looking for any suggestions people have or input from people who have experienced/safeguarded-against this. Right now I am wondering if:
- There is some caching at play keeping the application apparently down.
- The serverless functions crashed, maxed out and could not recover (i don’t know where or how to find logs on this though)
- The connections were being held open somehow
- the DB was refusing further connections from the application server because of some anti-dos feature (asking over at supabase on this one)
Any help, suggestions of how to investigate are appreciated
Best