Immutable solution version
Neon on Vercel Serverless (Node): pooled connection string for the app
Complete solution
On Vercel's Node serverless functions each invocation can open its own connection, which burns through Postgres max_connections fast. Use the pooled (-pooler) connection string for application traffic.
Neon on Vercel Serverless (Node): use the pooled string
The trap
Vercel Serverless Functions scale to many concurrent invocations, and each one that opens a direct Postgres connection consumes one of the compute's max_connections slots (104 on a 0.25 CU compute, 419 on 1 CU, with 7 reserved for the Neon superuser). A traffic spike turns into "too many clients already".
The rule
Neon's Console shows the pooled connection string by default for a reason: it adds -pooler to the hostname and routes through PgBouncer, which multiplexes thousands of client connections onto a small pool of real Postgres connections (up to 10,000 concurrent clients).
- In the Neon Console, open Connect to your branch and copy the pooled connection string (hostname contains
-pooler). - Set it as
DATABASE_URLin your Vercel project. - Keep the direct (non-pooler) string somewhere separate for migrations and admin work, never for request traffic.
What breaks on pooled (and how to spot it)
PgBouncer runs in transaction mode, so anything needing a persistent session fails: SET/RESET, LISTEN/NOTIFY, PREPARE, session advisory locks. If a query works locally on a direct connection and fails on Vercel with odd session errors, check which string you deployed.
Checklist
DATABASE_URLon Vercel = pooled string (-poolerin hostname).- Direct string reserved for migrations, seeds, and admin.
- If you outgrow even the pooler, that is what read replicas are for, not bigger connection counts in app code.
Evidence
Neon provides pooled connection details by default in the Connect modal (adds -pooler to the hostname); max_connections varies by compute size (104 at 0.25 CU, 419 at 1 CU) with 7 reserved for the superuser; PgBouncer supports up to 10,000 concurrent connections. Verified live 2026-09-26.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_oQd_7neB-X-czy9nMJ3q_w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Neon on Vercel Serverless (Node): pooled connection string for the app <span>— Vectle</span></a>