PgBouncer
A lightweight connection-pooling middleware for PostgreSQL. Running as a standalone process between an application and the database, it reduces connection-establishment overhead by reusing existing database connections, significantly improving database access performance under high-concurrency workloads.
Timeline (last 90 days)
PgBouncer is the most commonly used lightweight connection pool middleware in the Postgres ecosystem, sitting between the application and the database and reducing the overhead of frequent connection establishment by reusing backend connections.
PgBouncer supports three pooling modes: session, transaction and statement, among which transaction mode has the highest reuse efficiency but does not support features that depend on session state (such as prepared statements and advisory locks held across transactions).
Common implementations of connection pooling include the standalone process PgBouncer (suitable for ultra-high concurrency) and application-layer connection pools (such as n8n's built-in TypeORM connection pool).
All Facts (11)
In addition to connection pooling, Pgpool-II provides capabilities such as load balancing, automatic failover, parallel queries, and online recovery, but its pure connection pooling performance is inferior to PgBouncer.
60%UnverifiedPgBouncer supports three pooling modes: session, transaction and statement, among which transaction mode has the highest reuse efficiency but does not support features that depend on session state (such as prepared statements and advisory locks held across transactions).
50%UnverifiedPgBouncer is the most commonly used lightweight connection pool middleware in the Postgres ecosystem, sitting between the application and the database and reducing the overhead of frequent connection establishment by reusing backend connections.
50%UnverifiedCommon implementations of connection pooling include the standalone process PgBouncer (suitable for ultra-high concurrency) and application-layer connection pools (such as n8n's built-in TypeORM connection pool).
50%UnverifiedTransaction pooling is the most commonly used mode in production environments; it returns backend connections to the pool after each transaction ends, but causes session-level features to be unavailable across transactions.
50%UnverifiedStatement pooling recycles connections after each SQL statement finishes execution, does not support multi-statement transactions at all, and is only suitable for autocommit mode.
50%UnverifiedTransaction-level pooling occupies connections only during transaction execution and is the most commonly used high-efficiency mode.
50%UnverifiedApplication-layer connection pooling manages connection reuse within a single application instance, while PgBouncer addresses centralized front-end connection pooling — the two solve problems at different layers.
50%UnverifiedWhen an application's connection count is far below the max_connections limit, uses an application-layer connection pool, and has long-lived connections, PgBouncer can be omitted.
50%UnverifiedSession-level pooling exclusively holds a connection for the entire duration of a client session, offering the best compatibility but the lowest reuse rate.
50%UnverifiedPgBouncer provides three pooling modes: Session, Transaction, and Statement.
50%