prisma-connection-pool-exhaustion

Configure Prisma connection pooling with PgBouncer or Prisma Accelerate for serverless deployments.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Serverless environments create new Prisma clients for each invocation, which opens multiple database connections and quickly exhausts the database's connection limit, causing timeouts and errors.

Core Features & Use Cases

  • Implement per-instance connection pooling between serverless functions and the database using PgBouncer or Prisma Accelerate.
  • Configure Prisma's datasource and client to respect a small, configurable connection limit.
  • Apply singleton patterns in development to avoid multiple clients during hot reloads and ensure production-grade reliability.
  • Suitable for PostgreSQL, MySQL, and managed databases in Vercel, AWS Lambda, Netlify, and other serverless platforms.

Quick Start

Configure a single Prisma client per serverless instance, enable pooling, and tune your connection URL to enforce a small limit, then deploy and verify stable database connections under load.

Frequently Asked Questions about prisma-connection-pool-exhaustion

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

FAQPage Schema
Why does Prisma connection pool exhaustion happen in serverless environments?

Implementing a singleton pattern creates a single Prisma client per serverless instance, preventing the instantiation of multiple clients during hot reloads in development and stabilizing production database connections.

How do I configure Prisma connection pooling for AWS Lambda or Vercel?

To configure Prisma connection pooling for AWS Lambda or Vercel, implement a singleton client pattern, route traffic through PgBouncer or Prisma Accelerate, and tune the datasource connection URL to enforce a small per-instance connection limit.

Does this Prisma pooling approach work with both PostgreSQL and MySQL serverless deployments?

Yes, this Prisma pooling approach works with both PostgreSQL and MySQL serverless deployments on Vercel, AWS Lambda, and Netlify. It applies environment-based tuning and pooling strategies to ensure production-grade reliability across both database types.

What is the best way to limit Prisma database connections in Node.js serverless functions?

The best way to limit Prisma database connections in Node.js serverless functions is enforcing a small configurable connection limit within the Prisma datasource, combined with PgBouncer or Prisma Accelerate to manage pooling between functions and the database.

Do I need PgBouncer or Prisma Accelerate to prevent Prisma pool exhaustion?

You need either PgBouncer or Prisma Accelerate to prevent Prisma pool exhaustion, as they manage connection pooling between serverless functions and the database, complementing the singleton pattern and per-instance connection limits for production-grade reliability.