Skip to content

ozontech/pg_doorman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

316 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg_doorman

PgDoorman

BDD Tests License: MIT Docs Telegram

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.

Available in English and Русский.

Quick start

docker run -p 6432:6432 \
  -v $(pwd)/pg_doorman.yaml:/etc/pg_doorman/pg_doorman.yaml \
  ghcr.io/ozontech/pg_doorman

Generate a config from your PostgreSQL:

pg_doorman generate --host db.example.com --user postgres --output pg_doorman.yaml

Connect 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.

Highlights

  • Multithreaded — one process, one shared pool across all worker threads.
  • Prepared statements in transaction mode — transparent caching and statement remap; no driver hacks, no DISCARD ALL.
  • 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-migration cargo feature. Learn more.
  • Built-in observability — Prometheus endpoint, HDR-histogram percentiles, structured JSON logs, 18 admin SHOW commands.

Full feature comparison →

Benchmarks

Continuously updated AWS Fargate results (pgbench, multiple scenarios) live on the benchmarks page. PgDoorman is multiple times faster than PgBouncer on extended-protocol and prepared-statement workloads, and noticeably ahead of Odyssey under the same scenarios.

Community

License

MIT — see LICENSE.

Packages

 
 
 

Contributors