ExpressPostgreSQL

Creating database connections per request exhausts pool

critical
Connection ManagementUpdated Feb 8, 2026(via Exa)
How to detect:

Creating new database connections for each request (new pg.Client) instead of using a connection pool causes connection exhaustion and severe performance degradation.

Recommended action:

Use connection pool with bounded max connections (recommended: 20), idle timeout (30000ms), and connection timeout (2000ms). Reuse connections via pool.query().