Fix “remaining connection slots are reserved” in PostgreSQL
Why Postgres refuses new logins with “remaining connection slots are reserved”, how to find who holds the connections, and how to pool and cap them for good.
Troubleshooting guides start from a symptom you can see: an error code in the browser, a 504 from a serverless function, a database connection that keeps failing. Each one explains what the error means, the usual causes in order of how often they happen and the fix for each.
They are written for the engineer looking at the problem right now. Every guide shows the commands and code to find the cause, from tailing logs to tracing a slow request, then the change that fixes it and how to confirm the fix held. They cover Cloudflare Workers, Hyperdrive, Vercel functions, Kubernetes, Postgres and the other platforms teams deploy to most, and they say plainly when a problem is a platform limit and not your code. A guide that starts from one exact error message shows that message first, so you can check it matches yours.
How Polylane works on these platforms: Supabase, Vercel and Cloudflare.
Why Postgres refuses new logins with “remaining connection slots are reserved”, how to find who holds the connections, and how to pool and cap them for good.
Why a Vercel Function returns 500 FUNCTION_INVOCATION_FAILED, how to find the crash in runtime logs, and how to fix throws, missing env vars, files and memory.
Error 1101 means your Cloudflare Worker threw an uncaught JavaScript exception. Find the exception in logs, match it to its cause, fix it and roll back fast.