You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/enterprise_edition/control_plane.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ PgDog transmits the following information to the control plane:
59
59
| [Query statistics](insights/statistics.md) | Real-time statistics on each query executed through PgDog, like duration, idle-in-transaction time, and more. |
60
60
| [Errors](insights/errors.md) | Recent errors encountered by clients, e.g. query syntax issues. |
61
61
| [Query plans](insights/query_plans.md) | Output of `EXPLAIN` for slow and sampled queries, collected by PgDog in the background. |
62
-
| [Configuration](configuration.md) | Current PgDog settings and database schema. |
62
+
| Configuration | Current PgDog settings and database schema. |
Copy file name to clipboardExpand all lines: docs/enterprise_edition/insights/errors.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ The following information is available in the errors view:
35
35
36
36
## Configuration
37
37
38
-
Errors are collected automatically if query statistics are enabled. The in-memory view is periodically purged of old errors, configurable in [`pgdog.toml`](../configuration/pgdog.toml/general.md):
38
+
Errors are collected automatically if query statistics are enabled. The in-memory view is periodically purged of old errors, configurable in [`pgdog.toml`](../../configuration/pgdog.toml/general.md):
PgDog has built-in functionality for monitoring the state of Postgres replica databases. If configured, it can also automatically detect when a replica is promoted and redirect write queries to the new primary.
7
+
PgDog has built-in functionality for monitoring the state of Postgres replica databases. If configured, it can also automatically detect when a replica is promoted and redirect write queries to the new primary, and ban replicas from serving traffic if they have fallen far behind in the replication stream.
8
8
9
9
## Replication
10
10
@@ -57,6 +57,30 @@ Decreasing the value of `lsn_check_interval` will produce more accurate statisti
57
57
58
58
It's common for PgDog deployments to be serving upwards of 30,000-50,000 queries per second per pooler process, so you can run the LSN check query quite frequently without noticeable impact on system latency.
59
59
60
+
### Replica lag ban
61
+
62
+
!!! note "Experimental feature"
63
+
This feature is new and experimental. Please report any issues you encounter.
64
+
65
+
If a replica has fallen far behind the primary, it may start serving stale data to the application. This can cause hard to debug issues, so it's often best to remove this replica from the load balancer until it's able to catch up.
66
+
67
+
PgDog supports this with configurable banning thresholds:
68
+
69
+
```toml
70
+
[general]
71
+
ban_replica_lag = 60_000# 1 minute
72
+
ban_replica_lag_bytes = 25_000_000# 25 MiB
73
+
```
74
+
75
+
| Setting | Description |
76
+
|-|-|
77
+
|`ban_replica_lag`| How far behind in [transaction time](#replication-lag) (ms) can the replica fall before it gets removed from the load balancer. |
78
+
|`ban_replica_lag_bytes`| Same as above, except the lag is measured in bytes. |
79
+
80
+
The load balancer will use the lowest threshold to make its determination. By default, both settings are set to the maximum integer value, effectively **disabling** this feature.
81
+
82
+
Unlike [health check-triggered](healthchecks.md) bans, replica lag ban is not cleared after hitting the [`ban_timeout`](../../configuration/pgdog.toml/general.md#ban_timeout) threshold and will remain in place until the replica lag falls below the configured amount(s). Incidentally, by removing traffic from the replica database, it has a better chance of catching up to the primary, since most causes of replication lag in PostgreSQL are related to query load.
0 commit comments