dev

Deploy Postgres with PgBouncer

Add PgBouncer as a connection pooler in front of Postgres

Deploy Postgres with PgBouncer

Postgres PgBouncer

Adds PgBouncer as a connection pooler in front of your Postgres database.

Connecting

Use DATABASE_URL from the PgBouncer service instead of connecting directly to Postgres.

For operations transaction pooling can't serve (migrations, LISTEN/NOTIFY, session-level SET), use DATABASE_UNPOOLED_URL (or DATABASE_PUBLIC_UNPOOLED_URL over the public network) — they point straight at the database.

Configuration

VariableDefaultDescription
POOL_MODEtransactionsession, transaction, or statement
MAX_CLIENT_CONN1000Max total client connections
DEFAULT_POOL_SIZE70Server connections per db/user pair

Template Content