| title | description | ms.service | ms.subservice | ms.topic | ms.author | ms.date |
|---|---|---|---|---|---|---|
Azure Database for PostgreSQL Flexible Server - PgBouncer metrics (Preview) |
Metrics to monitor PgBouncer |
postgresql |
flexible-server |
conceptual |
varun.dhawan |
11/01/2022 |
PgBouncer is an open-source, lightweight, single-binary connection pooler for PostgreSQL. It can pool connections to one or more databases (on possibly different servers) and serve clients over TCP and Unix domain sockets. Azure Database for PostgreSQL – Flexible Server offers PgBouncer as a built-in connection pooling solution.
PgBouncer also provides an internal database that you can connect to called pgbouncer. Once connected to the database you can execute SHOW commands that provide information on the current state of pgbouncer.
- SHOW HELP - list all the available show commands
- SHOW POOLS — show number of connections in each state for each pool
- SHOW DATABASES - show current applied connection limits for each database
- SHOW STATS - show stats on requests and traffic for every database
- Most of these new metrics are disabled by default
- To enable these metrics, please turn ON the server parameter
pgbouncer.diagnostics.- This parameter is dynamic, and will not require instance restart.
| Metrics ID | Description | SHOW commands | Dimension | Status |
|---|---|---|---|---|
| pgbouncer.pools.cl_active | Client connections linked to server connection and able to process queries | SHOW POOLS | DatabaseName | Committed (M26) |
| pgbouncer.pools.cl_waiting | Client connections waiting on a server connection | SHOW POOLS | DatabaseName | Committed (M26) |
| pgbouncer.pools.sv_active | Server connections linked to a client connection | SHOW POOLS | DatabaseName | Committed (M26) |
| pgbouncer.pools.sv_idle | Server connections idle and ready for a client query | SHOW POOLS | DatabaseName | Committed (M26) |
| pgbouncer.database.active_connections | Current number of connections (client-2-pgBouncer) | SHOW DATABASES | DatabaseName | Committed (M26) |
| pgbouncer.pools.pools_per_database | Total no. of pools per DB | CUSTOM METRICS | DatabaseName | Committed (M26) |
- PgBouncer Admin Console - https://www.pgbouncer.org/usage.html
- Engineering - [email protected], [email protected]
- Product - [email protected], [email protected]