@@ -18,51 +18,6 @@ is necessary, this page describes settings that can be changed.
18
18
For conceptual information about the balancer, see
19
19
:ref:`sharding-balancing` and :ref:`sharding-balancing-internals`.
20
20
21
- .. index:: balancing; secondary throttle
22
- .. index:: secondary throttle
23
- .. _sharded-cluster-config-secondary-throttle:
24
-
25
- Require Replication before Chunk Migration (Secondary Throttle)
26
- ---------------------------------------------------------------
27
-
28
- .. versionadded:: 2.2.1
29
-
30
- You can configure the balancer to wait for replication to secondaries
31
- during migrations. You do so by enabling the balancer's
32
- ``_secondaryThrottle`` parameter, which reduces throughput (i.e.,
33
- "throttles") in order to decrease the load on secondaries. You might do
34
- this, for example, if you have migration-caused I/O peaks that impact
35
- other workloads
36
-
37
- When enabled, secondary throttle puts a ``{ w : 2 }`` write concern on
38
- deletes and on copies, which means the balancer waits for those
39
- operations to replicate to at least one secondary before migrating
40
- chunks.
41
-
42
- .. BACKGROUND NOTES
43
- Specifically, secondary throttle affects the first and fourth
44
- phases (informal phases) of chunk migration. Migration can happen during
45
- the second and third phases (the "steady state"):
46
- 1) copies the documents in the chunk from shardA to shardB
47
- 2) continues to copy over ongoing changes that occurred during the initial copy step,
48
- as well as current changes to that chunk range
49
- 3) Stop writes, allow shardB to get final changes, commit migration to config server
50
- 4) cleanup now-inactive data on shardA in chunk range (once all cursors are done)
51
-
52
- You enable ``_secondaryThrottle`` directly in the
53
- :data:`settings <~config.settings>` collection in the :ref:`config database
54
- <config-database>` by running the following commands from the
55
- :program:`mongo` shell:
56
-
57
- .. code-block:: javascript
58
-
59
- use config
60
- db.settings.update( { "_id" : "balancer" } , { $set : { "_secondaryThrottle" : true } } )
61
-
62
- You also can enable secondary throttle when issuing the
63
- :dbcommand:`moveChunk` command by setting ``_secondaryThrottle`` to
64
- ``true``. For more information, see :dbcommand:`moveChunk`.
65
-
66
21
.. _sharded-cluster-config-balancing-window:
67
22
68
23
Schedule a Window of Time for Balancing to Occur
@@ -84,7 +39,7 @@ Configure Default Chunk Size
84
39
----------------------------
85
40
86
41
The default chunk size for a sharded cluster is 64 megabytes. In most
87
- situations, the default size is optimal for splitting and migrating
42
+ situations, the default size is appropriate for splitting and migrating
88
43
chunks. For information on how chunk size affects deployments, see
89
44
details, see :ref:`sharding-chunk-size`.
90
45
@@ -102,9 +57,10 @@ The ``maxSize`` field in the :data:`~config.shards` collection in the
102
57
:ref:`config database <config-database>` sets the maximum size for a
103
58
shard, allowing you to control whether the balancer will migrate chunks
104
59
to a shard. If :data:`dataSize <~dbStats.dataSize>` is above a shard's
105
- ``maxSize``, the balancer will not move chunks to the shard. The
106
- balancer also will not move chunks off the shard. The ``maxSize`` value
107
- only affects the balancer's selection of destination shards.
60
+ ``maxSize``, the balancer will not move chunks to the shard. Also, the
61
+ balancer will not move chunks off an overloaded shard. This must happen
62
+ manually. The ``maxSize`` value only affects the balancer's selection of
63
+ destination shards.
108
64
109
65
By default, ``maxSize`` is not specified, allowing shards to consume the
110
66
total amount of available space on their machines if necessary.
@@ -140,7 +96,7 @@ megabytes.
140
96
.. code-block:: javascript
141
97
142
98
use config
143
- db.shards.update( { _id : "shard0000" }, { $set : { maxSize : 125 } }, { upsert: true } )
99
+ db.shards.update( { _id : "shard0000" }, { $set : { maxSize : 125 } } )
144
100
145
101
To later increase the ``maxSize`` setting to 250 megabytes, run the
146
102
following:
@@ -149,3 +105,48 @@ megabytes.
149
105
150
106
use config
151
107
db.shards.update( { _id : "shard0000" }, { $set : { maxSize : 250 } } )
108
+
109
+ .. index:: balancing; secondary throttle
110
+ .. index:: secondary throttle
111
+ .. _sharded-cluster-config-secondary-throttle:
112
+
113
+ Require Replication before Chunk Migration (Secondary Throttle)
114
+ ---------------------------------------------------------------
115
+
116
+ .. versionadded:: 2.2.1
117
+
118
+ You can configure the balancer to wait for replication to secondaries
119
+ during migrations. You do so by enabling the balancer's
120
+ ``_secondaryThrottle`` parameter, which reduces throughput (i.e.,
121
+ "throttles") in order to decrease the load on secondaries. You might do
122
+ this, for example, if you have migration-caused I/O peaks that impact
123
+ other workloads
124
+
125
+ When enabled, secondary throttle puts a ``{ w : 2 }`` write concern on
126
+ deletes and on copies, which means the balancer waits for those
127
+ operations to replicate to at least one secondary before migrating
128
+ chunks.
129
+
130
+ .. BACKGROUND NOTES
131
+ Specifically, secondary throttle affects the first and fourth
132
+ phases (informal phases) of chunk migration. Migration can happen during
133
+ the second and third phases (the "steady state"):
134
+ 1) copies the documents in the chunk from shardA to shardB
135
+ 2) continues to copy over ongoing changes that occurred during the initial copy step,
136
+ as well as current changes to that chunk range
137
+ 3) Stop writes, allow shardB to get final changes, commit migration to config server
138
+ 4) cleanup now-inactive data on shardA in chunk range (once all cursors are done)
139
+
140
+ You enable ``_secondaryThrottle`` directly in the
141
+ :data:`settings <~config.settings>` collection in the :ref:`config database
142
+ <config-database>` by running the following commands from the
143
+ :program:`mongo` shell:
144
+
145
+ .. code-block:: javascript
146
+
147
+ use config
148
+ db.settings.update( { "_id" : "balancer" } , { $set : { "_secondaryThrottle" : true } , { upsert : true } } )
149
+
150
+ You also can enable secondary throttle when issuing the
151
+ :dbcommand:`moveChunk` command by setting ``_secondaryThrottle`` to
152
+ ``true``. For more information, see :dbcommand:`moveChunk`.
0 commit comments