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

Add maxConnecting in asio connpool

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.15, 3.4.6, 3.5.9
    • Component/s: Networking
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v3.4, v3.2
    • Sprint:
      Platforms 2017-05-29, Platforms 2017-06-19
    • 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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: