prisma-connection-pool-exhaustion

Configure per-instance connection limits and a PrismaClient singleton for serverless Prisma deployments.

1|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/chipoto69/claude-skills --skill prisma-connection-pool-exhaustion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-connection-pool-exhaustion
Source: https://github.com/chipoto69/claude-skills/tree/main/claudeception/examples/prisma-connection-pool-exhaustion
Command: npx skills add https://github.com/chipoto69/claude-skills --skill prisma-connection-pool-exhaustion

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solves database connection pool exhaustion in serverless Prisma deployments.

Core Features & Use Cases

  • Connection pooling: Uses a pooler (PgBouncer/Prisma Accelerate) between serverless functions and the database to limit per-instance connections.
  • Prisma client singleton: Implements a global singleton PrismaClient to avoid multiple client instances across hot-reloads.
  • Deployment resilience: Applies to commonly used providers (Vercel, AWS Lambda, Netlify Functions) with PostgreSQL or MySQL backends.

Quick Start

  • Configure DATABASE_URL with pooling parameters (connection_limit=1, pool_timeout, connect_timeout) or use a provider-specific pooled URL.
  • Add a global PrismaClient singleton and ensure it is reused across requests.
  • Consider a dedicated pooler like PgBouncer or Prisma Accelerate where supported.
  • Deploy and monitor database connections to verify stability.

Frequently Asked Questions about prisma-connection-pool-exhaustion

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Prisma database connection pool exhaust in serverless environments?

Serverless platforms like Vercel and AWS Lambda spawn isolated function instances that rapidly multiply Prisma client connections, exhausting the database connection pool. This Skill configures per-instance connection limits and external poolers to stabilize deployments.

How do I configure Prisma Client to prevent connection exhaustion on Vercel?

To prevent connection exhaustion on Vercel, configure DATABASE_URL with connection_limit=1 and implement a global singleton PrismaClient. This ensures a single instance is reused across hot-reloads to prevent connection spikes.

What is the best way to pool Prisma connections for AWS Lambda and PostgreSQL?

The best way to pool Prisma connections for AWS Lambda and PostgreSQL is routing traffic through a dedicated pooler like PgBouncer or Prisma Accelerate. Combine this with a singleton PrismaClient to restrict per-instance connection limits.

Do I need PgBouncer or Prisma Accelerate for Netlify Functions using Prisma?

You need PgBouncer or Prisma Accelerate for Netlify Functions using Prisma to manage concurrent requests effectively. These poolers sit between serverless functions and the database to limit and queue active connection requests.

Can I use the same Prisma connection pooling configuration for MySQL backends?

Yes, you can apply this connection pooling configuration for MySQL backends in serverless deployments. The singleton PrismaClient pattern and connection_limit parameters work across PostgreSQL, MySQL, and other compatible databases.