@@ -3019,46 +3019,97 @@ Sharding Parameters
3019
3019
.. parameter:: ShardingTaskExecutorPoolReplicaSetMatching
3020
3020
3021
3021
.. versionadded:: 4.2
3022
+ .. versionchanged:: 5.0 (*Also starting in 4.4.5 and
3023
+ 4.2.13*)
3022
3024
3023
3025
Type: string
3024
3026
3025
- Default: "matchPrimaryNode "
3027
+ Default: "automatic "
3026
3028
3027
3029
|both|
3028
-
3029
- The policy that determines the minimum size limit of the
3030
- :binary:`~bin.mongos` instance's connection pools to the sharded
3031
- cluster's replica set secondaries.
3030
+
3031
+ On a :binary:`~bin.mongos` instance, this parameter sets the policy
3032
+ that determines the minimum size limit of its connection pools to
3033
+ nodes within replica sets.
3034
+
3035
+ On a :binary:`~bin.mongod` instance, this parameter sets the policy
3036
+ that determines the minimum size limit of its connection pools to
3037
+ nodes within *other* replica sets.
3038
+
3039
+ Note that this parameter only manages connections for operations that
3040
+ are directly related to user requests and CRUD operations.
3032
3041
3033
3042
Available values are:
3034
-
3043
+
3035
3044
.. list-table::
3036
3045
:header-rows: 1
3037
3046
:widths: 15 85
3038
-
3047
+
3039
3048
* - Matching Policy
3040
3049
- Description
3041
3050
3042
- * - ``"matchPrimaryNode "`` (Default)
3043
-
3044
- - For each replica set in the sharded cluster (specifically,
3045
- shard replica set and config servers), the minimum size limit
3046
- of the :binary:`~bin.mongos` instance's connection pool to
3047
- each secondary of that replica set is equal to the size of its
3048
- connection pool to the primary .
3051
+ * - ``"automatic "`` (Default)
3052
+
3053
+ - Starting in 5.0 (and 4.4.5 and 4.2.13), ``"automatic"`` is the
3054
+ new default value.
3055
+
3056
+ When set for a :binary:`~bin.mongos`, the instance follows the
3057
+ behavior specified for the ``"matchPrimaryNode"`` option .
3049
3058
3050
- In case of primary stepdown, ``matchPrimaryNode`` ensures
3059
+ When set for a :binary:`~bin.mongod`, the instance follows the
3060
+ behavior specified for the ``"disabled"`` option.
3061
+
3062
+ .. note::
3063
+
3064
+ If the
3065
+ :parameter:`ShardingTaskExecutorPoolReplicaSetMatching` is
3066
+ set to ``"automatic"``, the
3067
+ :data:`~connPoolStats.replicaSetMatchingStrategy` still
3068
+ describes the actual policy being used, not
3069
+ ``"automatic"``. To find the value of the
3070
+ :parameter:`ShardingTaskExecutorPoolReplicaSetMatching`,
3071
+ use :dbcommand:`getParameter` which returns the value of
3072
+ the server parameter.
3073
+
3074
+ * - ``"matchPrimaryNode"``
3075
+
3076
+ - When set for a :binary:`~bin.mongos`, the minimum size limit
3077
+ of the instance's connection pool to each secondary of a
3078
+ replica set in the sharded cluster (specifically, shard
3079
+ replica set and config servers) is equal to the size of its
3080
+ connection pool to that replica set's primary.
3081
+
3082
+ When set for a :binary:`~bin.mongod`, the minimum size limit
3083
+ of the instance's connection pool to each secondary of
3084
+ another replica set in the sharded cluster (specifically,
3085
+ shard replica set and config servers) is equal to the size of
3086
+ its connection pool to that replica set's primary.
3087
+
3088
+ .. warning::
3089
+
3090
+ If multiple shard servers in your topology can experience a
3091
+ rapid influx of cross-shard operations, do not set this
3092
+ option on your :binary:`~bin.mongod` instances.
3093
+
3094
+ In case of a primary stepdown, ``matchPrimaryNode`` ensures
3051
3095
that any secondary that becomes the primary can handle the
3052
3096
current level of primary reads and writes.
3053
3097
3054
3098
* - ``"matchBusiestNode"``
3055
3099
3056
- - For each replica set in the sharded cluster (specifically,
3057
- shard replica set and config servers), the minimum size limit
3058
- of the :binary:`~bin.mongos` instance's connection pool to
3059
- each member of that replica set is equal to the largest among
3060
- the active connections counts to the primary and each
3061
- secondary members.
3100
+ - When set for a :binary:`~bin.mongos`, the instance's minimum
3101
+ size limit of the connection pool to each member of a replica
3102
+ set in the sharded cluster (specifically, shard replica set
3103
+ and config servers) is equal to the largest among the active
3104
+ connection counts to the primary and each secondary member of
3105
+ that replica set.
3106
+
3107
+ When set for a :binary:`~bin.mongod`, the instance's minimum
3108
+ size limit of the connection pool to each member of another
3109
+ replica set in the sharded cluster (specifically, shard
3110
+ replica set and config servers) is equal to the largest among
3111
+ the active connection counts to the primary and each
3112
+ secondary member of that replica set.
3062
3113
3063
3114
With ``"matchBusiestNode"``, :binary:`~bin.mongos` maintains
3064
3115
enough connections to each secondary to handle the current
@@ -3068,26 +3119,32 @@ Sharding Parameters
3068
3119
3069
3120
* - ``"disabled"``
3070
3121
3071
- - For each replica set in the sharded cluster (specifically,
3072
- shard replica set and config servers), the minimum number of
3073
- connections in the :binary:`~bin.mongos` instance's connection
3074
- pool to each secondary is equal to the
3075
- :parameter:`ShardingTaskExecutorPoolMinSize`.
3122
+ - When set for a :binary:`~bin.mongos`, the instance's minimum
3123
+ number of connections in the instance's connection pool to
3124
+ each node of a replica set in the sharded clusterv
3125
+ (specifically, shard replica set and config servers) is equal
3126
+ to the :parameter:`ShardingTaskExecutorPoolMinSize`.
3127
+
3128
+ When set for a :binary:`~bin.mongod`, the instance's minimum
3129
+ number of connections in the instance's connection pool to
3130
+ each node of another replica set in the sharded cluster
3131
+ (specifically, shard replica set and config servers) is equal
3132
+ to the :parameter:`ShardingTaskExecutorPoolMinSize`.
3076
3133
3077
3134
The following example sets the
3078
3135
:parameter:`ShardingTaskExecutorPoolReplicaSetMatching` to
3079
- ``"matchBusiestNode "`` during startup:
3136
+ ``"automatic "`` during startup:
3080
3137
3081
3138
.. code-block:: sh
3082
3139
3083
- mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="matchBusiestNode "
3140
+ mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="automatic "
3084
3141
3085
3142
During runtime, you can also set the parameter with the
3086
3143
:dbcommand:`setParameter` command:
3087
3144
3088
3145
.. code-block:: javascript
3089
3146
3090
- db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "matchBusiestNode " } )
3147
+ db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "automatic " } )
3091
3148
3092
3149
.. parameter:: taskExecutorPoolSize
3093
3150
0 commit comments