Skip to content

Commit dfc5346

Browse files
authored
DOCS-11680 updating migration threshold (#5301)
* DOCS-11680 updating migration threshold * DOCS-11680 adding sentence about zones
1 parent eda95b9 commit dfc5346

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

source/core/sharding-balancer-administration.txt

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -191,32 +191,23 @@ chunks during balancing.
191191
Migration Thresholds
192192
~~~~~~~~~~~~~~~~~~~~
193193

194-
To minimize the impact of balancing on the cluster, the
195-
:term:`balancer` only begins balancing after the distribution of
196-
chunks for a sharded collection has reached certain thresholds. The
197-
thresholds apply to the difference in number of :term:`chunks <chunk>`
198-
between the shard with the most chunks for the collection and the shard
199-
with the fewest chunks for that collection. The balancer has the
200-
following thresholds:
201-
202-
.. list-table::
203-
:header-rows: 1
204-
205-
* - Number of Chunks
206-
- Migration Threshold
207-
208-
* - Fewer than 20
209-
- 2
210-
211-
* - 20-79
212-
- 4
213-
214-
* - 80 and greater
215-
- 8
216-
217-
The balancer stops running on the target collection when the difference
218-
between the number of chunks on any two shards for that collection is *less
219-
than two*, or a chunk migration fails.
194+
To minimize the impact of balancing on the cluster, the :term:`balancer`
195+
begins balancing only after the distribution of data for a sharded
196+
collection has reached the migration threshold that makes the cluster
197+
unbalanced. When the number of chunks on the most loaded shard exceeds
198+
the optimal number of chunks per shard by more than 1 chunk, the
199+
collection is unbalanced and the :term:`balancer` initiates chunk
200+
migrations. The optimal number of chunks per shard is the total number
201+
of chunks in a sharded collection divided by the number of shards,
202+
rounded up to the nearest integer. If :term:`zones <zone>` exist,
203+
MongoDB calculates the optimal number of chunks on a per-zone basis.
204+
205+
For example, if a user adds a new shard to a collection of 10 shards
206+
with 20 chunks each, the :term:`balancer` does not migrate any data. The
207+
optimal number of chunks on each shard is 200 divided by 11, or 18.18,
208+
which MongoDB rounds up to 19. Because the difference between 19 and 20
209+
is 1, the cluster is balanced and the :term:`balancer` does not migrate
210+
any chunks to the new shard.
220211

221212
.. seealso::
222213

0 commit comments

Comments
 (0)