Consistently hitting max clients/connections on postgres
Hey, I just launched my app 2 days ago, its being hosted on vercel atm. Despite having barely no users (max spike was 34 users/h) I keep getting an error about hitting the max connections allowed on the db.
This is a Nextjs app using Drizzle along with Supabase. Only using the supabase client for checking auth, always awaited, and all db queries are done through Drizzle. I am using the transaction pool url and followed the setup on the supabase docs.
I will also be posting this on the Supabase discord.
Has anyone experienced something like this before? I imagine its something related on how the clients are getting called or the client setup but any help is more than welcome.
4 Replies
I had this a lot on dev mode, but not production. What's your config look like?
I was having this on dev as well due the HRM but i changed a bit the config and it helped a lot, just not sure why this would happen on prod tho.
Is there a specific reason why you set poolConfig?
This is my implementation, which is similar but I just use the defaults of things.
just testing things out, thought it might solve the issue ahahah