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

Add pool stats for ShardedConnection

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.4, 2.4.2, 2.5.0
    • Component/s: Diagnostics, Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      Currently, the connPoolStats will only get stats from the extern pool object. This is linked to the pool ScopedDBConnection uses and it does not include the shardConnectionPool.

      Add a new command called "shardConnPoolStats" which will show information on the per thread (incoming connection) connection status. Sample output for a sharded cluster with a single replica set below:

      mongos> db.runCommand( { 'shardConnPoolStats': 1 } )
      {
      	"hosts" : {
      		"test-rs0/dan-tm2:31100,dan-tm2:31101,dan-tm2:31102::0" : {
      			"available" : 0,
      			"created" : 2
      		}
      	},
      	"replicaSets" : {
      		"test-rs0" : {
      			"hosts" : [
      				{
      					"addr" : "dan-tm2:31100",
      					"ok" : true,
      					"ismaster" : true,
      					"hidden" : false,
      					"secondary" : false,
      					"pingTimeMillis" : 0
      				},
      				{
      					"addr" : "dan-tm2:31101",
      					"ok" : true,
      					"ismaster" : false,
      					"hidden" : false,
      					"secondary" : true,
      					"pingTimeMillis" : 0
      				},
      				{
      					"addr" : "dan-tm2:31102",
      					"ok" : true,
      					"ismaster" : false,
      					"hidden" : false,
      					"secondary" : true,
      					"pingTimeMillis" : 0
      				}
      			],
      			"master" : 0,
      			"nextSlave" : 0
      		}
      	},
      	"createdByType" : {
      		"set" : 2
      	},
      	"totalAvailable" : 0,
      	"totalCreated" : 2,
      	"threads" : [
      		{
      			"hosts" : [
      				{
      					"host" : "test-rs0/dan-tm2:31100,dan-tm2:31101,dan-tm2:31102",
      					"created" : NumberLong(1),
      					"avail" : true
      				}
      			],
      			"seenNS" : [
      				"test.data"
      			]
      		},
      		{
      			"hosts" : [
      				{
      					"host" : "test-rs0/dan-tm2:31100,dan-tm2:31101,dan-tm2:31102",
      					"created" : NumberLong(1),
      					"avail" : true
      				}
      			],
      			"seenNS" : [
      				"test.data"
      			]
      		}
      	],
      	"ok" : 1
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: