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.
Last edited October 18, 2026
On this page
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.
Find a fix pack
Checklists and prompts for Supabase security, Stripe payments and deploys. Each pack is $24, or $49 for all three.
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
- Supabase → Connect → choose Transaction pooler and copy the string (uses port 6543). Supabase recommends this for serverless/edge functions.
- Set it as
DATABASE_URLin Vercel and redeploy. - Prisma: use the pooled URL for the app and keep a direct URL for migrations; set a small
connection_limitper instance. - Transaction mode doesn't support prepared statements/pipelining in some setups; follow your ORM's guidance for pgbouncer/transaction mode.
- 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.
Once the pooler accepts the connection, Prisma can still fail on a prepared statement. See Prisma: prepared statement already exists.
Sources
Related fixes
Tool to consider: Supabase.
Find a fix pack
Checklists and prompts for Supabase security, Stripe payments and deploys. Each pack is $24, or $49 for all three.