How PgBouncer Works

21 points by jstoja


bitshift

The article takes a long time to get to the point:

Postgres uses one OS process per connection. Each connection costs a few MB of private memory plus scheduler and snapshot overhead, and the connect-time fork/TLS dance is multiple milliseconds.

PgBouncer is a single-threaded libevent-based proxy that multiplexes many client connections onto fewer real Postgres backends.

The conclusion is pretty apt, though maybe not in the way the author intended!

There’s no big lesson at the end of this.

I wish they had skipped the whole three-act structure and written something short and personal instead ("Here's a Postgres fact I learned this week!"). That's the sort of thing I would have loved to read.

gerardnico

Well written.