Skip to content

Commit 4a2a34f

Browse files
Merge pull request #2146 from redis/DOC-5120
Add resharding section to memory-limit documentation
2 parents 223ad03 + 785dbbb commit 4a2a34f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

content/operate/rs/databases/memory-performance/memory-limit.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,32 @@ Databases should return to their configured memory limits after data is removed
7979

8080
If you observe this behavior, consider [monitoring]({{< relref "/operate/rs/monitoring/" >}}) memory usage and controlling the traffic load on the application side.
8181

82+
## Resharding duration factors
83+
84+
Resharding enables you to increase database capacity by adding shards and utilizing more cluster memory. Understanding resharding duration helps you plan maintenance operations and minimize database risk.
85+
86+
### Resharding overview
87+
88+
Resharding follows a three-stage process for each new shard:
89+
90+
1. **Shard creation**: Creates a new shard and performs partial synchronization based on assigned hash slots
91+
2. **Key trimming**: Removes keys from the original shard according to new hash slot assignments
92+
3. **Defragmentation**: Executes failovers to optimize new shard performance
93+
94+
When resharding multiple shards (for example, expanding from 4 to 8 shards), this process runs serially for each new shard. The operation completes only after all stages finish for every shard.
95+
96+
{{< note >}}
97+
Resharding is an atomic operation that cannot be interrupted. Database corruption can occur if the process fails or stops unexpectedly. Minimizing resharding time reduces this risk.
98+
{{< /note >}}
99+
100+
### Resharding duration factors
101+
102+
Resharding duration increases linearly with the number of keys in your database. Key length and network traffic affect resharding duration:
103+
104+
Key length directly affects resharding duration. Longer keys (2000 KB) require more time to process due to increased hash calculation overhead per key compared to short keys (10 bytes).
105+
106+
Network traffic has a measurable but limited effect on resharding duration. Since resharding operations typically don't reach CPU limits, the impact on both resharding time and ongoing traffic remains minimal.
107+
82108
## Memory metrics
83109

84110
The Cluster Manager UI provides metrics that can help you evaluate your memory use.

0 commit comments

Comments
 (0)