The PgBouncer Operator deploys and operates the PgBouncer lightweight connection pooler for PostgreSQL.
As this charm is not yet published, you need to follow the build and deploy instructions from CONTRIBUTING.md. This charm creates one pgbouncer application instance per CPU core on each machine it is deployed.
Set these using the command juju config <option>=<value>
.
-
pool_mode
:- default:
session
- Specifies when a server connection can be reused by other clients.
- Can be one of the following values:
- session
- Server is released back to pool after client disconnects.
- transaction
- Server is released back to pool after transaction finishes.
- statement
- Server is released back to pool after query finishes. Transactions spanning multiple statements are disallowed in this mode.
- session
- default:
-
max_db_connections
:- default:
0
- Do not allow more than this many server connections per database (regardless of user). This considers the PgBouncer database that the client has connected to, not the PostgreSQL database of the outgoing connection.
- Note that when you hit the limit, closing a client connection to one pool will not immediately allow a server connection to be established for another pool, because the server connection for the first pool is still open. Once the server connection closes (due to idle timeout), a new server connection will immediately be opened for the waiting pool.
- 0 = unlimited
- default:
From these values and the current deployment, the following pgbouncer.ini config values are calculated:
effective_db_connections = max_db_connections / number of pgbouncer instances running on a machine
default_pool_size = effective_db_connections / 2
min_pool_size = effective_db_connections / 4
reserve_pool_size = effective_db_connections / 4
The following config values are set as constants in the charm:
max_client_conn = 10000
ignore_startup_parameters = extra_float_digits
extra_float_digits
is a parameter in postgres
db:[pgsql](https://github.com/canonical/ops-lib-pgsql/)
db-admin:[pgsql](https://github.com/canonical/ops-lib-pgsql/)
backend-db-admin:[pgsql](https://github.com/canonical/ops-lib-pgsql/)
- Provides a relaton to the corresponding postgresql-operator charm.
The following relations provide support for the LMA charm bundle, our expected observability stack.
prometheus:prometheus_scrape
loki:loki_push_api
grafana:grafana_dashboards
The Charmed PgBouncer Operator is free software, distributed under the Apache Software License, version 2.0. See LICENSE for more information.
Security issues in the Charmed PgBouncer Operator can be reported through LaunchPad. Please do not file GitHub issues about security issues.
Please see the Juju SDK docs for guidelines on enhancements to this charm following best practice guidelines, and CONTRIBUTING.md for developer guidance.