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: content/operate/rs/databases/active-active/planning.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,33 @@ It's also important to know Active-Active databases have a lower threshold for a
48
48
49
49
For more information on memory limits, see [Memory and performance]({{< relref "/operate/rs/databases/memory-performance/" >}}) or [Database memory limits]({{< relref "/operate/rs/databases/memory-performance/memory-limit.md" >}}).
50
50
51
+
### Replication OOM protection
52
+
53
+
When a shard in an Active-Active database reaches an out-of-memory (OOM) condition:
54
+
55
+
1. Replication between that shard and its peers stops immediately.
56
+
57
+
1. The syncer process sends commands to the affected shard to trigger garbage collection and free memory.
58
+
59
+
If the database has no [eviction policy]({{<relref "/operate/rs/databases/memory-performance/eviction-policy/">}}) and no keys with [expiration times (TTL)]({{<relref "/develop/using-commands/keyspace#key-expiration">}}), no memory can be freed, which can lead to persistent replication failure and data desynchronization.
60
+
61
+
To reduce this risk, Active-Active databases running Redis version 8.4 or later support a configurable memory buffer through the `replication_oom_threshold_percent` setting. This setting reserves a percentage of memory below `maxmemory` for internal replication operations.
62
+
63
+
The `replication_oom_threshold_percent` setting works as follows:
64
+
65
+
- If memory usage is below the threshold, all client writes proceed normally.
66
+
67
+
- If memory usage exceeds the threshold, Redis blocks external client write commands with an out-of-memory error, but internal replication and garbage collection continue in the reserved buffer.
68
+
69
+
- If memory reaches `maxmemory` despite the client block, the standard out-of-memory behavior applies to all operations, including replication.
70
+
71
+
`replication_oom_threshold_percent` defaults to `5`, which means 5% of `maxmemory` is reserved. To adjust the reserved percentage, use an [update database configuration]({{<relref "operate/rs/references/rest-api/requests/bdbs#put-bdbs">}}) REST API request:
72
+
73
+
```sh
74
+
PUT https://<host>:<port>/v1/bdbs/<database_id>
75
+
{ "replication_oom_threshold_percent": <integer from 0 to 20> }
76
+
```
77
+
51
78
## Networking
52
79
53
80
Network requirements for Active-Active databases include:
Copy file name to clipboardExpand all lines: content/operate/rs/databases/memory-performance/memory-limit.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,33 @@ but tries to avoid stopping primary shards.
67
67
We recommend that you have a [monitoring platform]({{< relref "/operate/rs/monitoring/" >}}) that alerts you before a system gets low on RAM.
68
68
You must maintain sufficient free memory to make sure that you have a healthy Redis Software installation.
69
69
70
+
### Active-Active replication OOM protection
71
+
72
+
When a shard in an Active-Active database reaches an out-of-memory (OOM) condition:
73
+
74
+
1. Replication between that shard and its peers stops immediately.
75
+
76
+
1. The syncer process sends commands to the affected shard to trigger garbage collection and free memory.
77
+
78
+
If the database has no [eviction policy]({{<relref "/operate/rs/databases/memory-performance/eviction-policy/">}}) and no keys with [expiration times (TTL)]({{<relref "/develop/using-commands/keyspace#key-expiration">}}), no memory can be freed, which can lead to persistent replication failure and data desynchronization.
79
+
80
+
To reduce this risk, Active-Active databases running Redis version 8.4 or later support a configurable memory buffer through the `replication_oom_threshold_percent` setting. This setting reserves a percentage of memory below `maxmemory` for internal replication operations.
81
+
82
+
The `replication_oom_threshold_percent` setting works as follows:
83
+
84
+
- If memory usage is below the threshold, all client writes proceed normally.
85
+
86
+
- If memory usage exceeds the threshold, Redis blocks external client write commands with an out-of-memory error, but internal replication and garbage collection continue in the reserved buffer.
87
+
88
+
- If memory reaches `maxmemory` despite the client block, the standard out-of-memory behavior applies to all operations, including replication.
89
+
90
+
`replication_oom_threshold_percent` defaults to `5`, which means 5% of `maxmemory` is reserved. To adjust the reserved percentage, use an [update database configuration]({{<relref "operate/rs/references/rest-api/requests/bdbs#put-bdbs">}}) REST API request:
91
+
92
+
```sh
93
+
PUT https://<host>:<port>/v1/bdbs/<database_id>
94
+
{ "replication_oom_threshold_percent": <integer from 0 to 20> }
95
+
```
96
+
70
97
## Adaptive memory allocation
71
98
72
99
In rare cases during high-velocity data ingestion, databases can temporarily reach up to 200% of their configured memory limit. This adaptive memory allocation strategy allows large amounts of data to be written to the database quickly without rejecting valid transactions.
0 commit comments