"Why use PgBouncer?
It’s a lightweight, easy to configure connection pooler and it does one job well.
As you’d expect from a talk on connection pooling, we’ll give a brief summary of connection pooling and why it increases efficiency. We’ll look at when not to use connection pooling, and we’ll demonstrate how to configure PgBouncer and how it works.
But. Did you know you can also do this?
1. Scaling PgBouncer
PgBouncer is single threaded which means a single instance of PgBouncer isn’t going to do you much good on a multi-threaded and/or multi-CPU machine. We’ll show you how to add more PgBouncer instances so you can use more than one thread for easy scaling.
2. Read-write / read only routing
Using different pgBouncer databases you can route read-write traffic to the primary database and route read-only traffic to a number of standby databases.
3. Load balancing
When we use multiple PgBouncer instances, load balancing comes for free. Load balancing can be directed to different standbys, and weighted according to ratios of load.
4. Silent failover
You can perform silent failover during promotion of a new primary (assuming you have a VIP/DNS etc that always points to the primary).
5. And even: DoS prevention and protection from “badly behaved” applications!
By using distinct port numbers you can provide database connections which deal with sudden bursts of incoming traffic in very different ways, which can help prevent the database from becoming swamped during high activity periods.
You should leave the presentation wondering if there is anything PgBouncer can’t do."
Registrations for Postgres London 2021 are open. Register now to reserve your spot.
WHERE: Virtual Event WHEN: Wednesday | May 12, 2021