prisma-connection-pool-exhaustion
CommunityFix Prisma pool exhaustion in serverless apps.
Software Engineering#serverless#nodejs#prisma#lambda#pgbouncer#prisma-client#database-connection-pool
AuthorHankanman
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Serverless deployments spawn new Prisma clients per cold start, which opens several database connections and can exhaust the database's connection pool, causing timeouts and degraded performance.
Core Features & Use Cases
- Connection pooling with PgBouncer or Prisma Accelerate to cap concurrent connections.
- Provider-specific guidance for managed databases (Supabase, Neon) and how to enable pooling.
- PrismaClient singleton pattern to avoid creating new clients on every invocation.
Quick Start
- Update your DATABASE_URL to use a pooled connection string when supported (e.g., Supabase: postgresql://...:6543/...?pgbouncer=true).
- Limit connections in Prisma by configuring the datasource and optional URL parameters, e.g., append ?connection_limit=1 to the DATABASE_URL.
- Implement a PrismaClient singleton in your codebase (development and production) to survive hot reloads and cold starts.
- Verify with a load test and monitor database connections to ensure they stay within limits.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: prisma-connection-pool-exhaustion Download link: https://github.com/Hankanman/claude-config/archive/main.zip#prisma-connection-pool-exhaustion Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.