From b575935b1d8b871ef0de7f5148e9be8bfec3d381 Mon Sep 17 00:00:00 2001 From: Sean McGivern <27fv8yygye@snkmail.com> Date: Wed, 18 Sep 2024 12:56:17 +0100 Subject: [PATCH] Improve documentation for connect_timeout and add min_pool_size (#822) Currently, `connect_timeout` sounds like it should be for connections to the Postgres server. It's actually used for obtaining a connection from the pool. --- CONFIG.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/CONFIG.md b/CONFIG.md index 7635bf6b..4e984ede 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -36,10 +36,11 @@ Port at which prometheus exporter listens on. ### connect_timeout ``` path: general.connect_timeout -default: 5000 # milliseconds +default: 1000 # milliseconds ``` -How long to wait before aborting a server connection (ms). +How long the client waits to obtain a server connection before aborting (ms). +This is similar to PgBouncer's `query_wait_timeout`. ### idle_timeout ``` @@ -462,10 +463,18 @@ path: pools..users..pool_size default: 9 ``` -Maximum number of server connections that can be established for this user +Maximum number of server connections that can be established for this user. The maximum number of connection from a single Pgcat process to any database in the cluster is the sum of pool_size across all users. +### min_pool_size +``` +path: pools..users..min_pool_size +default: 0 +``` + +Minimum number of idle server connections to retain for this pool. + ### statement_timeout ``` path: pools..users..statement_timeout @@ -475,6 +484,16 @@ default: 0 Maximum query duration. Dangerous, but protects against DBs that died in a non-obvious way. 0 means it is disabled. +### connect_timeout +``` +path: pools..users..connect_timeout +default: # milliseconds +``` + +How long the client waits to obtain a server connection before aborting (ms). +This is similar to PgBouncer's `query_wait_timeout`. +If unset, uses the `connect_timeout` defined globally. + ## `pools..shards.` Section ### servers @@ -502,4 +521,3 @@ default: "shard0" ``` Database name (e.g. "postgres") -