
Scaling Postgres Connections With PgBouncer
By Ben Dicken The Postgres process-per-connection architecture has an elegant simplicity, but hinders performance when tons of clients need to connect simultaneously. The near-universal choice for solving this problem is PgBouncer. Though there are upcoming systems like Neki which will solve this problem in a more robust way, PgBouncer has proven itself an excellent connection pooler for Postgres. PlanetScale gives you local PgBouncers by default, and makes it incredibly easy to add dedicated ones when needed. The challenge comes in determining the optimal configuration for your app, which is highly use-case dependent. My aim with this article is to make every engineer well-equipped to tune PgBouncer with confidence. Why PgBouncer? PgBouncer is a lightweight connection pooler that sits between your application and Postgres. PgBouncer is totally transparent, speaking the PostgreSQL wire protocol. From an app's perspective, it's just talking to a Postgres server, PgBouncer acting as a li
Continue reading on Dev.to
Opens in a new tab



