ww77
PPrisma
•Created by ww77 on 4/30/2024 in #help-and-questions
Error querying the database: FATAL: Max client connections reached
Hi! I'm building a NextJS app with Supabase as my DB, and using Trigger.dev for background jobs. I've been running into the "Max client connections reached" error a lot, and it's heavily impacting production.
I've gone through both of these docs:
- https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool
- https://supabase.com/docs/guides/database/connecting-to-postgres#connection-pooler
My supabase DB URL looks like this:
<DB_CONNECTION_STRING>?pgbouncer=true&connection_limit=200&connect_timeout=300&pool_timeout=0
I have thousands of long running jobs that should be closing the connection after each run, but the jobs sometimes run for minutes at a time.
How can I debug this further? Am I missing something obvious?4 replies