# pgbouncer/pgbouncer

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/pgbouncer-pgbouncer).**

3,937 stars · 539 forks · C · other

## Links

- GitHub: https://github.com/pgbouncer/pgbouncer
- Homepage: https://www.pgbouncer.org/
- awesome-repositories: https://awesome-repositories.com/repository/pgbouncer-pgbouncer.md

## Topics

`postgresql`

## Description

PgBouncer is a lightweight middleware proxy server and connection pooler for PostgreSQL. It acts as a database connection manager and load balancer, reducing system overhead by managing a pool of reusable connections and distributing incoming traffic across multiple backend servers.

The project distinguishes itself through a protocol-level proxying approach that handles authentication and TLS encryption without parsing underlying SQL queries. It provides specialized support for mapping named prepared statements across different backend connections and implements a socket-sharing process model to distribute network traffic across multiple CPU cores.

The software covers a broad range of resource management capabilities, including concurrent connection limiting, idle connection timeouts, and various connection assignment strategies. It integrates centralized authentication via LDAP and PAM, offers real-time connection state inspection, and supports zero-downtime process restarts and graceful shutdowns.

The system integrates with systemd on Linux and as a service on Windows for automated lifecycle management.

## Tags

### Data & Databases

- [PostgreSQL Pool Managers](https://awesome-repositories.com/f/data-databases/connection-pools/postgresql-pool-managers.md) — Provides a specialized connection pool manager tailored for the PostgreSQL wire protocol and server behavior.
- [Connection Pooling](https://awesome-repositories.com/f/data-databases/high-concurrency-database-access/connection-pooling.md) — Manages a pool of reusable backend connections assigned to clients based on session or transaction boundaries.
- [Resource Limits](https://awesome-repositories.com/f/data-databases/connection-pools/postgresql-pool-managers/resource-limits.md) — Prevents database crashes by capping concurrent connections and terminating idle sessions to save system resources.
- [Database Connection Managers](https://awesome-repositories.com/f/data-databases/database-connection-managers.md) — Manages the lifecycle of database connections and implements session or transaction-level pooling.
- [Connection Pool Managers](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/connection-transaction-management/connection-pool-managers.md) — Controls minimum and maximum pool sizes to maintain stability during traffic spikes. ([source](https://www.pgbouncer.org/config.html))
- [Connection Limit Managers](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/connection-transaction-management/connection-pool-managers/backend-server-pools/connection-limit-managers.md) — Caps the maximum number of global or per-user connections to protect system resource capacity. ([source](https://www.pgbouncer.org/config.html))
- [PostgreSQL Proxy Servers](https://awesome-repositories.com/f/data-databases/postgresql-proxy-servers.md) — Functions as a network intermediary handling authentication, TLS encryption, and routing between clients and PostgreSQL databases.
- [Cross-Connection Mapping](https://awesome-repositories.com/f/data-databases/prepared-statements/cross-connection-mapping.md) — Tracks client-side prepared statements and mirrors them across various backend connections for transparent query execution.
- [Connection Pool Observability](https://awesome-repositories.com/f/data-databases/connection-pools/connection-pool-observability.md) — Provides real-time inspection of active clients and connection pools to debug connectivity and resource usage. ([source](https://www.pgbouncer.org/usage.html))
- [Idle Connection Cleanup](https://awesome-repositories.com/f/data-databases/connection-pools/idle-connection-cleanup.md) — Automatically closes inactive database connections and terminates long-running transactions to reclaim system resources. ([source](https://www.pgbouncer.org/config.html))
- [PostgreSQL Load Balancers](https://awesome-repositories.com/f/data-databases/postgresql-load-balancers.md) — Distributes incoming database traffic across multiple backend PostgreSQL servers to optimize throughput and availability.
- [Statement Synchronization](https://awesome-repositories.com/f/data-databases/prepared-statements/statement-synchronization.md) — Tracks and rewrites named prepared statements to ensure they remain available across different assigned server connections. ([source](https://www.pgbouncer.org/2025/01/pgbouncer-1.24.0))

### Networking & Communication

- [Load Balancers](https://awesome-repositories.com/f/networking-communication/load-balancers.md) — Balances incoming database traffic across multiple backend hosts using strategies like round-robin to optimize throughput. ([source](https://www.pgbouncer.org/config.html))
- [Connection Pooling Strategies](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-infrastructure-configuration/network-infrastructure/connection-pooling-strategies.md) — Assigns server connections based on session, transaction, or statement strategies to optimize performance. ([source](https://cdn.jsdelivr.net/gh/pgbouncer/pgbouncer@master/README.md))
- [Protocol-Level Proxying](https://awesome-repositories.com/f/networking-communication/protocol-level-proxying.md) — Intercepts and forwards PostgreSQL wire protocol messages between clients and servers without parsing the underlying SQL queries.
- [Multi-Backend Routing](https://awesome-repositories.com/f/networking-communication/backend-proxies/multi-backend-routing.md) — Distributes client requests across multiple database servers residing on different physical hosts for improved scalability. ([source](https://www.pgbouncer.org/features.html))
- [Port Sharing Mechanisms](https://awesome-repositories.com/f/networking-communication/network-port-configuration/port-sharing-mechanisms.md) — Binds multiple process instances to the same network port to distribute traffic across CPU cores.
- [Socket Sharers](https://awesome-repositories.com/f/networking-communication/socket-networking/udp-socket-managers/socket-sharers.md) — Implements a socket-sharing model that binds multiple process instances to one port to distribute traffic across CPU cores. ([source](https://www.pgbouncer.org/config.html))

### Software Engineering & Architecture

- [Non-Blocking Event Loops](https://awesome-repositories.com/f/software-engineering-architecture/non-blocking-event-loops.md) — Manages all network I/O and timers using a non-blocking event loop to handle thousands of concurrent connections efficiently.

### Development Tools & Productivity

- [Dynamic Configuration](https://awesome-repositories.com/f/development-tools-productivity/dynamic-configuration.md) — Modifies operational parameters and reloads configuration files at runtime without requiring a restart. ([source](https://www.pgbouncer.org/features.html))
- [Connection State Resets](https://awesome-repositories.com/f/development-tools-productivity/session-capturers/session-state-serializers/session-state-querying/connection-state-resets.md) — Cleanses session variables and temporary state on a backend connection before returning it to the pool for reuse.

### DevOps & Infrastructure

- [Dynamic Configuration Reloading](https://awesome-repositories.com/f/devops-infrastructure/application-server-configurations/dynamic-configuration-reloading.md) — Updates internal state and operational parameters at runtime without disconnecting clients or restarting the process.
- [Connection Monitors](https://awesome-repositories.com/f/devops-infrastructure/cloud-infrastructure/networking-connectivity/connection-monitors.md) — Tracks whether client connections are active or idle to analyze real-time resource utilization. ([source](https://www.pgbouncer.org/2025/11/pgbouncer-1.25-0))
- [Zero-Downtime Binaries Upgrades](https://awesome-repositories.com/f/devops-infrastructure/graceful-shutdowns/zero-downtime-binaries-upgrades.md) — Upgrades the process while maintaining active client connections to prevent application downtime. ([source](https://www.pgbouncer.org/features.html))
- [Administrative Access Control](https://awesome-repositories.com/f/devops-infrastructure/high-availability-clustering/database-high-availability/administrative-access-control.md) — Provides the ability to pause or enable specific databases to manage client access during maintenance windows. ([source](https://www.pgbouncer.org/usage.html))

### Operating Systems & Systems Programming

- [Database PAM Authentication](https://awesome-repositories.com/f/operating-systems-systems-programming/pam-modules/database-pam-authentication.md) — Delegates user authentication to system-level pluggable authentication modules to verify identities using OS credentials. ([source](https://cdn.jsdelivr.net/gh/pgbouncer/pgbouncer@master/README.md))

### Security & Cryptography

- [Centralized Identity Management](https://awesome-repositories.com/f/security-cryptography/centralized-identity-management.md) — Integrates PostgreSQL access with external identity providers like LDAP and PAM for unified user management.
- [User Identity Verification](https://awesome-repositories.com/f/security-cryptography/identity-authentication/user-identity-verification.md) — Validates user credentials using multiple methods including certificates, external files, and directory services. ([source](https://www.pgbouncer.org/config.html))
- [LDAP Authentication](https://awesome-repositories.com/f/security-cryptography/ldap-authentication.md) — Validates user credentials against a centralized LDAP directory server for identity management. ([source](https://cdn.jsdelivr.net/gh/pgbouncer/pgbouncer@master/README.md))
- [Transport Layer Encryption](https://awesome-repositories.com/f/security-cryptography/transport-layer-encryption.md) — Secures data in transit between the client and the server using Transport Layer Security. ([source](https://www.pgbouncer.org/2025/11/pgbouncer-1.25-0))

### System Administration & Monitoring

- [Network Statistics Tracking](https://awesome-repositories.com/f/system-administration-monitoring/network-statistics-tracking.md) — Tracks transaction counts, query volume, and network traffic to analyze system load and bottlenecks. ([source](https://www.pgbouncer.org/usage.html))
