Connection Pooling, PgBouncer, and Managing Connections at Scale
Connection Pooling, PgBouncer, and Managing Connections at Scale
Every PostgreSQL connection is a forked OS process consuming ~5–10 MB of RAM. At 500 connections, that is 2.5–5 GB of RAM used just for connection overhead before a single query runs. Application servers that open a connection per request quickly exhaust this limit and start seeing "too many connections" errors. PgBouncer solves this.