Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29237

Add maxConnecting in asio connpool

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.15, 3.4.6, 3.5.9
    • Affects Version/s: None
    • Component/s: Networking
    • Labels:
    • Fully Compatible
    • v3.4, v3.2
    • Platforms 2017-05-29, Platforms 2017-06-19

      Issue Status as of Jun 15, 2017

      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.

      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.

      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.

            mira.carey@mongodb.com Mira Carey
            mira.carey@mongodb.com Mira Carey
            0 Vote for this issue
            10 Start watching this issue