prisma-connection-pool-exhaustion
Installation
SKILL.md
Prisma Connection Pool Exhaustion in Serverless
Problem
Serverless functions create a new Prisma client instance on each cold start. Each instance opens multiple database connections (default: 5 per instance). With many concurrent requests, this quickly exhausts the database's connection limit (often 20-100 for managed databases).
Context / Trigger Conditions
This skill applies when you see:
P2024: Timed out fetching a new connection from the connection pool- PostgreSQL:
FATAL: too many connections for role "username" - MySQL:
Too many connections - Works fine locally with
npm run devbut fails in production - Errors appear during traffic spikes, then resolve
- Database dashboard shows connections at or near limit