From 5bce30a0d14919827a899b047a2d33746af164d1 Mon Sep 17 00:00:00 2001 From: Max Zintel <43785951+maxzintel@users.noreply.github.com> Date: Thu, 22 Jun 2023 05:41:28 -0400 Subject: [PATCH] [bitnami/pgbouncer] Add reserve_pool_timeout to available environment variables (#37540) * [bitnami/pgbouncer] Add reserve pool timeout environment variable to pgbouncer. Description of the change: The default for this value being 5 seconds is too high for many usecases. We are adding it as an environment variable so it is easier for the user to determine what they would like the client wait time to be. Signed-off-by: Max Zintel <43785951+maxzintel@users.noreply.github.com> * [bitnami/pgbouncer] Add reserve pool timeout to libpgbouncer.sh file. Signed-off-by: Max Zintel <43785951+maxzintel@users.noreply.github.com> * [bitnami/pgbouncer] Add reserve pool timeout to pgbouncer-env.sh. Signed-off-by: Max Zintel <43785951+maxzintel@users.noreply.github.com> --------- Signed-off-by: Max Zintel <43785951+maxzintel@users.noreply.github.com> --- .../1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh | 1 + .../1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh | 2 ++ bitnami/pgbouncer/README.md | 1 + 3 files changed, 4 insertions(+) diff --git a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh index a13552100ee6..bfdd82248f09 100644 --- a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh +++ b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh @@ -258,6 +258,7 @@ pgbouncer_initialize() { "default_pool_size:${PGBOUNCER_DEFAULT_POOL_SIZE}" "min_pool_size:${PGBOUNCER_MIN_POOL_SIZE}" "reserve_pool_size:${PGBOUNCER_RESERVE_POOL_SIZE}" + "reserve_pool_timeout:${PGBOUNCER_RESERVE_POOL_TIMEOUT}" "ignore_startup_parameters:${PGBOUNCER_IGNORE_STARTUP_PARAMETERS}" "log_connections:${PGBOUNCER_LOG_CONNECTIONS}" "log_disconnections:${PGBOUNCER_LOG_DISCONNECTIONS}" diff --git a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh index 3d1cbff20083..f31d6bf885af 100644 --- a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh +++ b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh @@ -43,6 +43,7 @@ pgbouncer_env_vars=( PGBOUNCER_DEFAULT_POOL_SIZE PGBOUNCER_MIN_POOL_SIZE PGBOUNCER_RESERVE_POOL_SIZE + PGBOUNCER_RESERVE_POOL_TIMEOUT PGBOUNCER_IGNORE_STARTUP_PARAMETERS PGBOUNCER_EXTRA_FLAGS PGBOUNCER_STATS_PERIOD @@ -131,6 +132,7 @@ export PGBOUNCER_SERVER_RESET_QUERY="${PGBOUNCER_SERVER_RESET_QUERY:-}" export PGBOUNCER_DEFAULT_POOL_SIZE="${PGBOUNCER_DEFAULT_POOL_SIZE:-}" export PGBOUNCER_MIN_POOL_SIZE="${PGBOUNCER_MIN_POOL_SIZE:-}" export PGBOUNCER_RESERVE_POOL_SIZE="${PGBOUNCER_RESERVE_POOL_SIZE:-}" +export PGBOUNCER_RESERVE_POOL_TIMEOUT="${PGBOUNCER_RESERVE_POOL_TIMEOUT:-}" export PGBOUNCER_IGNORE_STARTUP_PARAMETERS="${PGBOUNCER_IGNORE_STARTUP_PARAMETERS:-}" export PGBOUNCER_EXTRA_FLAGS="${PGBOUNCER_EXTRA_FLAGS:-}" export PGBOUNCER_STATS_PERIOD="${PGBOUNCER_STATS_PERIOD:-60}" diff --git a/bitnami/pgbouncer/README.md b/bitnami/pgbouncer/README.md index e9dda7daacdc..bafa0961bc47 100644 --- a/bitnami/pgbouncer/README.md +++ b/bitnami/pgbouncer/README.md @@ -131,6 +131,7 @@ To expose the same database name as the backend, set `PGBOUNCER_DATABASE="$POSTG * `PGBOUNCER_DEFAULT_POOL_SIZE` : PgBouncer maximum server connections to allow per user/database pair. Default: **20**. * `PGBOUNCER_MIN_POOL_SIZE` : PgBouncer has at least this amount of open connections. Default: **0 (disabled)**. * `PGBOUNCER_RESERVE_POOL_SIZE` : PgBouncer allows this amount of additional connections. Default: **0 (disabled)**. +* `PGBOUNCER_RESERVE_POOL_TIMEOUT` : If a client has not been serviced in this time, use additional connections from the reserve pool. 0 disables. Default: **5.0** [seconds]. * `PGBOUNCER_IGNORE_STARTUP_PARAMETERS`: you can use this to set `ignore_startup_parameters` in the auto-generated `pgbouncer.ini`. This can be useful for solving certain connection issues. See config.html for more details. * `PGBOUNCER_SERVER_IDLE_TIMEOUT`: PgBouncer maximum time in seconds a server connection can be idle. If 0 then the timeout is disabled. Default: **600** * `PGBOUNCER_SERVER_RESET_QUERY`: PgBouncer query sent to server on connection release before making it available to other clients. Default: **DISCARD ALL**