Skip to content

Commit b575935

Browse files
authored
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.
1 parent efbab1c commit b575935

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

CONFIG.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ Port at which prometheus exporter listens on.
3636
### connect_timeout
3737
```
3838
path: general.connect_timeout
39-
default: 5000 # milliseconds
39+
default: 1000 # milliseconds
4040
```
4141

42-
How long to wait before aborting a server connection (ms).
42+
How long the client waits to obtain a server connection before aborting (ms).
43+
This is similar to PgBouncer's `query_wait_timeout`.
4344

4445
### idle_timeout
4546
```
@@ -462,10 +463,18 @@ path: pools.<pool_name>.users.<user_index>.pool_size
462463
default: 9
463464
```
464465

465-
Maximum number of server connections that can be established for this user
466+
Maximum number of server connections that can be established for this user.
466467
The maximum number of connection from a single Pgcat process to any database in the cluster
467468
is the sum of pool_size across all users.
468469

470+
### min_pool_size
471+
```
472+
path: pools.<pool_name>.users.<user_index>.min_pool_size
473+
default: 0
474+
```
475+
476+
Minimum number of idle server connections to retain for this pool.
477+
469478
### statement_timeout
470479
```
471480
path: pools.<pool_name>.users.<user_index>.statement_timeout
@@ -475,6 +484,16 @@ default: 0
475484
Maximum query duration. Dangerous, but protects against DBs that died in a non-obvious way.
476485
0 means it is disabled.
477486

487+
### connect_timeout
488+
```
489+
path: pools.<pool_name>.users.<user_index>.connect_timeout
490+
default: <UNSET> # milliseconds
491+
```
492+
493+
How long the client waits to obtain a server connection before aborting (ms).
494+
This is similar to PgBouncer's `query_wait_timeout`.
495+
If unset, uses the `connect_timeout` defined globally.
496+
478497
## `pools.<pool_name>.shards.<shard_index>` Section
479498

480499
### servers
@@ -502,4 +521,3 @@ default: "shard0"
502521
```
503522

504523
Database name (e.g. "postgres")
505-

0 commit comments

Comments
 (0)