#Error querying the database: FATAL: Max client connections reached

3 messages · Page 1 of 1 (latest)

sullen cedar
#

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:

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?

Prisma ORM's query engine creates a connection pool to store and manage database connections.

Supabase

Explore the options for connecting to your Postgres database.

spiral cragBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

oak pollen