# PgBouncer

> Lightweight connection pooler for PostgreSQL

Source: https://talira.ai/catalog/pgbouncer-ke0bbbm9
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Infrastructure
- Categories: [databases / postgres / connection pooling](https://talira.ai/categories/databases/postgres/connection-pooling)
- Platforms: linux, windows[^5][^6]
- Licence: ISC[^4]
- Pricing: Free and open source[^4]
- Free tier: yes[^4]
- Self-hostable: yes[^5]
- Creator: Marko Kreen, at Skype

PgBouncer is a lightweight connection pooler that sits between applications and [PostgreSQL](https://talira.ai/catalog/postgresql-cm55wcnd.md), so thousands of client connections share a small number of server connections. It pools per session, per transaction or per statement: transaction pooling gives the most reuse but breaks session features such as `SET`, `LISTEN` and session advisory locks, while protocol-level prepared statements work once `max_prepared_statements` is set. An admin console (a virtual `pgbouncer` database) shows pools and clients and can pause, resume and reload without dropping clients, and several processes can share a port with `so_reuseport` for rolling restarts. It's written in C and released under the ISC licence.

## Links

- Website: https://www.pgbouncer.org
- GitHub: https://github.com/pgbouncer/pgbouncer
- Docs: https://www.pgbouncer.org/usage.html

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/pgbouncer>[^1]
- [APT](https://talira.ai/catalog/apt-d7essv0z.md): <https://packages.debian.org/stable/pgbouncer>[^2]

## Problems it solves

- Postgres runs out of connections when our app scales to many web and worker processes
- FATAL: sorry, too many clients already from Postgres under load
- each Postgres connection costs memory, and we have hundreds of mostly idle ones
- serverless functions open a new database connection on every request and swamp the server
- share a small pool of Postgres connections across many application servers
- pause traffic to the database while we restart or fail over Postgres, without clients erroring
- restart our connection pooler without dropping client connections
- route several logical databases to different Postgres hosts behind one endpoint
- keep prepared statements working while pooling connections per transaction
- see how many clients are waiting for a database connection right now

## Features

- session, transaction and statement pooling modes
- protocol-level prepared statements in transaction mode (max_prepared_statements)
- admin console with SHOW, PAUSE, RESUME, RELOAD and SHUTDOWN commands
- rolling restarts with several processes on one port (so_reuseport) and peering
- TLS for client and server connections
- auth via userlist, auth_query, HBA file, PAM or LDAP
- per-database and per-user pool sizes and limits

## Limitations

- Doesn't support SET, LISTEN, session advisory locks or SQL PREPARE in transaction pooling mode: use session pooling for those[^3]

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.28 out of 1.
Signals: backing 0.20, extensibility 0.20.

- created by Marko Kreen, at Skype

Warnings:

- GitHub activity not fetched yet

## Related

- Works with [PostgreSQL](https://talira.ai/catalog/postgresql-cm55wcnd.md)

## Alternatives

- [Supavisor](https://talira.ai/catalog/supavisor-rd7r7r2r.md): A cloud-native, multi-tenant Postgres connection pooler
- [PgCat](https://talira.ai/catalog/pgcat-kb1dzs9p.md): PostgreSQL pooler with sharding, load balancing and failover support

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
[^2]: https://deb.debian.org/debian/dists/stable/main/source/Sources.xz (checked 21 Nov 2026)
[^3]: https://www.pgbouncer.org/features.html (checked 19 Nov 2026)
[^4]: https://github.com/pgbouncer/pgbouncer/blob/master/COPYRIGHT (checked 19 Nov 2026)
[^5]: https://www.pgbouncer.org/install.html (checked 19 Nov 2026)
[^6]: https://www.pgbouncer.org/downloads/ (checked 19 Nov 2026)
