Skip to content

Commit

Permalink
Improve documentation for connect_timeout and add min_pool_size (#822)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smcgivern authored Sep 18, 2024
1 parent efbab1c commit b575935
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -462,10 +463,18 @@ path: pools.<pool_name>.users.<user_index>.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.<pool_name>.users.<user_index>.min_pool_size
default: 0
```

Minimum number of idle server connections to retain for this pool.

### statement_timeout
```
path: pools.<pool_name>.users.<user_index>.statement_timeout
Expand All @@ -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.<pool_name>.users.<user_index>.connect_timeout
default: <UNSET> # 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.<pool_name>.shards.<shard_index>` Section

### servers
Expand Down Expand Up @@ -502,4 +521,3 @@ default: "shard0"
```

Database name (e.g. "postgres")

0 comments on commit b575935

Please sign in to comment.