Lab overlay:
docker compose -f deploy/compose/docker-compose.yml \
-f deploy/compose/pgbouncer.yml up -d
That pools api and worker in session mode. dhcpd keeps a direct DSN. The config cache uses LISTEN lattice_config, which transaction pooling cannot carry.
Production:
- Session pooling if you pool dhcpd at all.
- Transaction pooling is fine for api/worker only.
- Cap
default_pool_sizeagainstmax_connections. - Do not put a pool in front of Patroni’s REST API or WAL.
Most estates never need this. Scale dhcpd processes first. Postgres.