too many connections / remaining connection slots are reserved (Supabase + serverless)

Database errors like "too many connections" after deploying to Vercel? Use Supabase's transaction pooler (port 6543) for serverless functions.

Reviewed October 14, 2026

What it means in plain English

Each serverless function can open its own database connections. Under traffic, hundreds of copies run at once and use up all the database's connection slots.

Likely causes

  • Using the direct connection string (port 5432) from serverless/edge functions.
  • An ORM like Prisma creating a new pool per function instance.
  • Creating a new client on every request.

How to fix it, step by step

  1. Supabase → Connect → choose Transaction pooler and copy the string (uses port 6543). Supabase recommends this for serverless/edge functions.
  2. Set it as DATABASE_URL in Vercel and redeploy.
  3. Prisma: use the pooled URL for the app and keep a direct URL for migrations; set a small connection_limit per instance.
  4. Transaction mode doesn't support prepared statements/pipelining in some setups; follow your ORM's guidance for pgbouncer/transaction mode.
  5. If your host is IPv4-only, the direct connection may not be reachable; the shared pooler is IPv4-friendly.

How to check it worked

  • Load the site under normal traffic without connection errors.
  • Supabase dashboard shows connection counts well below the limit.

Sources

Can't fix it? Get help.

If the steps didn't clear the error, send what the screen says. A person can take a look. This is a request for a paid fix, not an instant chat.

Request a fix