-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Networking
-
None
-
Fully Compatible
-
v3.4, v3.2
-
Platforms 2017-05-29, Platforms 2017-06-19
-
(copied to CRM)
ISSUE DESCRIPTION
This ticket adds a new flag to mongos to allow users to control the rate at which new connections from a mongos to a mongod are created.
RATIONALE
This functionality is aimed at mitigating connection storms in the following scenario:
- a mongos has a high number of connections established to a given shard
- the shard's primary becomes temporarily unavailable (e.g.: during an election or a temporary network glitch)
- the shard's primary becomes available again (e.g.: new primary elected, network glitch resolved)
- the mongos will try to re-establish or refresh all connection to the shard's primary
It is possible for mongos nodes to overwhelm the primary with connection requests, which may have adverse consequences.
The ShardingTaskExecutorPoolMaxConnecting flag allows users to limit the rate at which mongos nodes add connectons to connection pools. The flag changes mongos behavior so that only N connections can be in the processing state at any one time (in setup/refresh) to avoid overwhelming mongod nodes with connection requests.
It is worth noting that this flag is per connection pool, so if a mongos node has C connection pools and ShardingTaskExecutorPoolMaxConnecting is set to N, the node may establish up to C * N connections to a mongod in a scenario like the one described above. Please see SERVER-25027 for more information on configuring connection pools.
The default value is unlimited for backwards-compatibility purposes. This default value may change in future versions of MongoDB.
SUPPORTED VERSIONS
This flag is available in MongoDB 3.5.9, 3.4.6, 3.2.15 and newer versions.
Original description
A new connection pool option which controls that rate at which we add new connections. It changes behavior so that only N connections can be in the processing state at any one time (in setup/refresh). More connections will be added, if needed, as each new connection completes, fails or times out.
Available in mongos via ShardingTaskExecutorPoolMaxConnecting, defaults to unlimited.
- is depended on by
-
SERVER-29206 MongoS [NetworkInterfaceASIO-TaskExecutorPool-0-0] ExceededTimeLimit: Operation timed out
- Closed
-
SERVER-29429 Pick a sane default for maxConnecting in sharding task executor
- Closed
- is duplicated by
-
SERVER-29206 MongoS [NetworkInterfaceASIO-TaskExecutorPool-0-0] ExceededTimeLimit: Operation timed out
- Closed
-
SERVER-28629 router blocks and throws ExceededTimeLimit
- Closed
-
SERVER-27880 Rate Limit Mongos Outbound Thread Creation
- Closed
- related to
-
SERVER-27880 Rate Limit Mongos Outbound Thread Creation
- Closed