📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials PostgreSQL Essentials Connection Pooling

Connection Pooling

6 min read
PgBouncer pools connections between your app and PostgreSQL. In transaction mode it shares connections across thousands of clients. This prevents connection exhaustion on busy apps without any code changes.

PgBouncer Connection Pooling

Each PostgreSQL connection consumes ~5-10MB of RAM. PgBouncer sits between your app and Postgres, reusing connections.

# pgbouncer.ini
[databases]
mydb = host=127.0.0.1 dbname=mydb

[pgbouncer]
listen_port = 6432
pool_mode = transaction
max_client_conn = 1000
default_pool_size = 20