@@ -2290,46 +2290,96 @@ Sharding Parameters
2290
2290
.. parameter:: ShardingTaskExecutorPoolReplicaSetMatching
2291
2291
2292
2292
.. versionadded:: 4.2
2293
+ .. versionchanged:: 4.2.13
2293
2294
2294
2295
Type: string
2295
2296
2296
- Default: "matchPrimaryNode "
2297
+ Default: "automatic "
2297
2298
2298
2299
|both|
2299
-
2300
- The policy that determines the minimum size limit of the
2301
- :binary:`~bin.mongos` instance's connection pools to the sharded
2302
- cluster's replica set secondaries.
2300
+
2301
+ On a :binary:`~bin.mongos` instance, this parameter sets the policy
2302
+ that determines the minimum size limit of its connection pools to
2303
+ nodes within replica sets.
2304
+
2305
+ On a :binary:`~bin.mongod` instance, this parameter sets the policy
2306
+ that determines the minimum size limit of its connection pools to
2307
+ nodes within *other* replica sets.
2308
+
2309
+ Note that this parameter only manages connections for operations that
2310
+ are directly related to user requests and CRUD operations.
2303
2311
2304
2312
Available values are:
2305
-
2313
+
2306
2314
.. list-table::
2307
2315
:header-rows: 1
2308
2316
:widths: 15 85
2309
-
2317
+
2310
2318
* - Matching Policy
2311
2319
- Description
2312
2320
2313
- * - ``"matchPrimaryNode "`` (Default)
2314
-
2315
- - For each replica set in the sharded cluster (i.e. shard
2316
- replica set and config servers), the minimum size limit of
2317
- the :binary:`~bin.mongos` instance's connection pool to each
2318
- secondary of that replica set is equal to the size of its
2319
- connection pool to the primary .
2321
+ * - ``"automatic "`` (Default)
2322
+
2323
+ - Starting in 4.2.13, ``"automatic"`` is the
2324
+ new default value.
2325
+
2326
+ When set for a :binary:`~bin.mongos`, the instance follows the
2327
+ behavior specified for the ``"matchPrimaryNode"`` option .
2320
2328
2321
- In case of primary stepdown, ``matchPrimaryNode`` ensures
2329
+ When set for a :binary:`~bin.mongod`, the instance follows the
2330
+ behavior specified for the ``"disabled"`` option.
2331
+
2332
+ .. note::
2333
+
2334
+ If the
2335
+ :parameter:`ShardingTaskExecutorPoolReplicaSetMatching` is
2336
+ set to ``"automatic"``, the
2337
+ :data:`~connPoolStats.replicaSetMatchingStrategy` still
2338
+ describes the actual policy being used, not
2339
+ ``"automatic"``. To find the value of the
2340
+ :parameter:`ShardingTaskExecutorPoolReplicaSetMatching`,
2341
+ use :dbcommand:`getParameter` which returns the value of
2342
+ the server parameter.
2343
+
2344
+ * - ``"matchPrimaryNode"``
2345
+
2346
+ - When set for a :binary:`~bin.mongos`, the minimum size limit
2347
+ of the instance's connection pool to each secondary of a
2348
+ replica set in the sharded cluster (specifically, shard
2349
+ replica set and config servers) is equal to the size of its
2350
+ connection pool to that replica set's primary.
2351
+
2352
+ When set for a :binary:`~bin.mongod`, the minimum size limit
2353
+ of the instance's connection pool to each secondary of
2354
+ another replica set in the sharded cluster (specifically,
2355
+ shard replica set and config servers) is equal to the size of
2356
+ its connection pool to that replica set's primary.
2357
+
2358
+ .. warning::
2359
+
2360
+ If multiple shard servers in your topology can experience a
2361
+ rapid influx of cross-shard operations, do not set this
2362
+ option on your :binary:`~bin.mongod` instances.
2363
+
2364
+ In case of a primary stepdown, ``matchPrimaryNode`` ensures
2322
2365
that any secondary that becomes the primary can handle the
2323
2366
current level of primary reads and writes.
2324
2367
2325
2368
* - ``"matchBusiestNode"``
2326
2369
2327
- - For each replica set in the sharded cluster (i.e. shard
2328
- replica set and config servers), the minimum size limit of
2329
- the :binary:`~bin.mongos` instance's connection pool to each
2330
- member of that replica set is equal to the largest among
2331
- the active connections counts to the primary and each
2332
- secondary members.
2370
+ - When set for a :binary:`~bin.mongos`, the instance's minimum
2371
+ size limit of the connection pool to each member of a replica
2372
+ set in the sharded cluster (specifically, shard replica set
2373
+ and config servers) is equal to the largest among the active
2374
+ connection counts to the primary and each secondary member of
2375
+ that replica set.
2376
+
2377
+ When set for a :binary:`~bin.mongod`, the instance's minimum
2378
+ size limit of the connection pool to each member of another
2379
+ replica set in the sharded cluster (specifically, shard
2380
+ replica set and config servers) is equal to the largest among
2381
+ the active connection counts to the primary and each
2382
+ secondary member of that replica set.
2333
2383
2334
2384
With ``"matchBusiestNode"``, :binary:`~bin.mongos` maintains
2335
2385
enough connections to each secondary to handle the current
@@ -2339,26 +2389,32 @@ Sharding Parameters
2339
2389
2340
2390
* - ``"disabled"``
2341
2391
2342
- - For each replica set in the sharded cluster (i.e. shard
2343
- replica set and config servers), the minimum number of
2344
- connections in the :binary:`~bin.mongos` instance's
2345
- connection pool to each secondary is equal to the
2346
- :parameter:`ShardingTaskExecutorPoolMinSize`.
2392
+ - When set for a :binary:`~bin.mongos`, the instance's minimum
2393
+ number of connections in the instance's connection pool to
2394
+ each node of a replica set in the sharded clusterv
2395
+ (specifically, shard replica set and config servers) is equal
2396
+ to the :parameter:`ShardingTaskExecutorPoolMinSize`.
2397
+
2398
+ When set for a :binary:`~bin.mongod`, the instance's minimum
2399
+ number of connections in the instance's connection pool to
2400
+ each node of another replica set in the sharded cluster
2401
+ (specifically, shard replica set and config servers) is equal
2402
+ to the :parameter:`ShardingTaskExecutorPoolMinSize`.
2347
2403
2348
2404
The following example sets the
2349
2405
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching` to
2350
- ``"matchBusiestNode "`` during startup:
2406
+ ``"automatic "`` during startup:
2351
2407
2352
2408
.. code-block:: sh
2353
2409
2354
- mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="matchBusiestNode "
2410
+ mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="automatic "
2355
2411
2356
2412
During runtime, you can also set the parameter with the
2357
2413
:dbcommand:`setParameter` command:
2358
2414
2359
2415
.. code-block:: javascript
2360
2416
2361
- db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "matchBusiestNode " } )
2417
+ db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "automatic " } )
2362
2418
2363
2419
.. parameter:: taskExecutorPoolSize
2364
2420
0 commit comments