Postgres Connection Pooling Cheat Sheet

PgBouncer settings for ORMs

Last Updated: November 21, 2025

Focus Areas

Focus
Match `max_client_conn` to DB capacity
Monitor `pgbouncer_stats` for waits

Commands & Queries

psql -h pgbouncer -c 'SHOW POOLS'
Inspect pools
pgbouncer -n pgbouncer.ini
Restart service
tail -f /var/log/pgbouncer.log
Watch errors

Summary

Connection pooling shields Postgres from spikes.

💡 Pro Tip: Use transaction mode when ORMs open many short-lived connections.
← Back to Databases & APIs | Browse all categories | View all cheat sheets