A multithreaded PostgreSQL connection pooler in Rust (MSRV 1.87). Alternative to PgBouncer, Odyssey, and PgCat. In production at Ozon for over three years across Go (pgx), .NET (Npgsql), Python (asyncpg, SQLAlchemy), and Node.js workloads.
📖 Full documentation: ozontech.github.io/pg_doorman
Configuration reference, tutorials, comparison with PgBouncer and Odyssey, benchmarks, deployment guides — all on the documentation site.
docker run -p 6432:6432 \
-v $(pwd)/pg_doorman.yaml:/etc/pg_doorman/pg_doorman.yaml \
ghcr.io/ozontech/pg_doormanGenerate a config from your PostgreSQL:
pg_doorman generate --host db.example.com --user postgres --output pg_doorman.yamlConnect and verify:
psql -h 127.0.0.1 -p 6432 -U admin pgdoorman -c "SHOW VERSION;"For installation from source, distribution packages (Ubuntu PPA, Fedora COPR), and the tls-migration build, see the Installation guide.
- Multithreaded — one process, one shared pool across all worker threads.
- Anonymous prepared statements get plan caching — PgBouncer 1.21+ and Odyssey forward the empty-name
Parseunchanged and re-plan on everyBind; pg_doorman remaps it toDOORMAN_<N>so the plan lands in the backend's named registry and gets reused across clients sharing the pool. Learn more. - Pool Coordinator — database-level connection cap with priority eviction and per-user minimums. Learn more.
- Patroni-assisted fallback — automatic backend rerouting via the Patroni REST API when the local node fails. Learn more.
- Graceful binary upgrade — replace the binary without dropping clients; TLS connections migrate cleanly with the
tls-migrationcargo feature. Learn more. - Built-in observability — Prometheus
/metricswith HDR-histogram percentiles, structured JSON logs, adminSHOWcommands.
Continuously updated pgbench results from AWS Fargate and Ubicloud (multiple scenarios) live on the benchmarks page. PgDoorman runs 3-4× ahead of PgBouncer on extended-protocol and prepared-statement workloads, and noticeably ahead of Odyssey under the same scenarios.
- Telegram: @pg_doorman
- Issues: github.com/ozontech/pg_doorman/issues
- Contributing: contributing guide
MIT — see LICENSE.
