[SERVER-29237] Add maxConnecting in asio connpool Created: 16/May/17  Updated: 30/Oct/23  Resolved: 02/Jun/17

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: 3.2.15, 3.4.6, 3.5.9

Type: New Feature Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-29206 MongoS [NetworkInterfaceASIO-TaskExec... Closed
is depended on by SERVER-29429 Pick a sane default for maxConnecting... Closed
Documented
is documented by DOCS-10352 Docs for SERVER-29237: Add maxConnect... Closed
Duplicate
is duplicated by SERVER-29206 MongoS [NetworkInterfaceASIO-TaskExec... Closed
is duplicated by SERVER-28629 router blocks and throws ExceededTime... Closed
is duplicated by SERVER-27880 Rate Limit Mongos Outbound Thread Cre... Closed
Related
related to SERVER-27880 Rate Limit Mongos Outbound Thread Cre... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.4, v3.2
Sprint: Platforms 2017-05-29, Platforms 2017-06-19
Participants:
Case:

 Description   
Issue Status as of Jun 15, 2017

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.



 Comments   
Comment by Githook User [ 15/Jun/17 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-29237 add maxConnecting in asio connpool

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.

(cherry picked from commit f75fb8f5eee2b91599334681ab2b1ebcf20b491c)
Branch: v3.4
https://github.com/mongodb/mongo/commit/ea703784a6ef1dc22b9023bcd40d8a1e8d4a5f71

Comment by Githook User [ 15/Jun/17 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-29237 add maxConnecting in asio connpool

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.

(cherry picked from commit f75fb8f5eee2b91599334681ab2b1ebcf20b491c)
Branch: v3.2
https://github.com/mongodb/mongo/commit/6ad1c52b68afff7c3698f3df143f10d2f747be06

Comment by Githook User [ 02/Jun/17 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-29237 add maxConnecting in asio connpool

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.
Branch: master
https://github.com/mongodb/mongo/commit/f75fb8f5eee2b91599334681ab2b1ebcf20b491c

Generated at Thu Feb 08 04:20:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.