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

established connections keep larger than connPoolMaxShardedConnsPerHost

    • Type: Icon: Question Question
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.2.17
    • Component/s: Networking
    • None

      1. mongos run with: --setParameter connPoolMaxShardedConnsPerHost=10
      2. use 24 mongo to connect mongos, 24 connections to mongos
      3. run command, such as:

      db.example.insert({'foo': 6})

      from the mongos log, i found:

      2017-12-18T12:01:48.525+0800 I NETWORK [conn21] Ending idle connection to host mongo1260/10.160.188.108:27017,10.160.189.108:27017,10.160.243.108:27017(with timeout of 0 seconds) because the pool meets constraints; 13 connections to that host remain open
      2017-12-18T12:01:48.526+0800 I NETWORK [conn11] Ending idle connection to host mongo1260/10.160.188.108:27017,10.160.189.108:27017,10.160.243.108:27017(with timeout of 0 seconds) because the pool meets constraints; 12 connections to that host remain open

      but I found there are still 22 connections from mongos to mongod(10.160.243.108), netstat command as below:

      netstat -antp | grep ESTABLISHED | fgrep '10.160.243.108:27017' | awk '{print $5}' | sort | uniq -c

      the 22 connections will always keep established. the output as below:

      22 10.160.243.108:27017

      so, may I have a wrong use on connPoolMaxShardedConnsPerHost ?

      official docs about connPoolMaxShardedConnsPerHost:

      Set the maximum size of the connection pools for communication to the shards. The size of a pool does not prevent the creation of additional connections, but does prevent the connection pools from retaining connections above this limit.

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            stutiredboy@gmail.com Adun
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: