Skip to content

Instantly share code, notes, and snippets.

@ajdavis
Last active May 7, 2019 13:03
Show Gist options
  • Save ajdavis/fe348967a752ec80fd701729baf21042 to your computer and use it in GitHub Desktop.
Save ajdavis/fe348967a752ec80fd701729baf21042 to your computer and use it in GitHub Desktop.
Example connPoolStats output for a 2-shard cluster, each shard is a 3-node replica set, the config replica set has 1 node
MongoDB shell version v0.0.0
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
WARNING: No implicit session: Logical Sessions are only supported on server versions 3.6 and greater.
Implicit session: dummy session
MongoDB server version: 3.4.20
WARNING: shell and server versions do not match
{
"numClientConnections" : 9,
"numAScopedConnections" : 0,
"totalInUse" : 0,
"totalAvailable" : 13,
"totalCreated" : 13,
"totalRefreshing" : 0,
"pools" : {
"NetworkInterfaceASIO-TaskExecutorPool-0" : {
"poolInUse" : 0,
"poolAvailable" : 1,
"poolCreated" : 1,
"poolRefreshing" : 0,
"localhost:27018" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"NetworkInterfaceASIO-ShardRegistry" : {
"poolInUse" : 0,
"poolAvailable" : 5,
"poolCreated" : 5,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 3,
"created" : 3,
"refreshing" : 0
},
"localhost:27018" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"global" : {
"poolInUse" : 0,
"poolAvailable" : 7,
"poolCreated" : 7,
"poolRefreshing" : 0,
"localhost:27023" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27024" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27022" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27018" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27020" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27019" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
}
},
"hosts" : {
"localhost:27023" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27024" : {
"inUse" : 0,
"available" : 4,
"created" : 4,
"refreshing" : 0
},
"localhost:27022" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27018" : {
"inUse" : 0,
"available" : 3,
"created" : 3,
"refreshing" : 0
},
"localhost:27020" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 2,
"created" : 2,
"refreshing" : 0
},
"localhost:27019" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"replicaSets" : {
"shard02" : {
"hosts" : [
{
"addr" : "localhost:27021",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27022",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27023",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
}
]
},
"configRepl" : {
"hosts" : [
{
"addr" : "localhost:27024",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
}
]
},
"shard01" : {
"hosts" : [
{
"addr" : "localhost:27018",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27019",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27020",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
}
]
}
},
"ok" : 1
}
MongoDB shell version v0.0.0
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("ddbf0aba-6a12-48d6-815d-80b31e268f7f") }
MongoDB server version: 3.6.12
WARNING: shell and server versions do not match
{
"numClientConnections" : 7,
"numAScopedConnections" : 0,
"totalInUse" : 0,
"totalAvailable" : 14,
"totalCreated" : 14,
"totalRefreshing" : 0,
"pools" : {
"NetworkInterfaceASIO-TaskExecutorPool-3" : {
"poolInUse" : 0,
"poolAvailable" : 1,
"poolCreated" : 1,
"poolRefreshing" : 0,
"localhost:27018" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"NetworkInterfaceASIO-TaskExecutorPool-2" : {
"poolInUse" : 0,
"poolAvailable" : 1,
"poolCreated" : 1,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"global" : {
"poolInUse" : 0,
"poolAvailable" : 7,
"poolCreated" : 7,
"poolRefreshing" : 0,
"localhost:27023" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27024" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27022" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27018" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27020" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27019" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"NetworkInterfaceASIO-ShardRegistry" : {
"poolInUse" : 0,
"poolAvailable" : 3,
"poolCreated" : 3,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 3,
"created" : 3,
"refreshing" : 0
}
},
"NetworkInterfaceASIO-TaskExecutorPool-0" : {
"poolInUse" : 0,
"poolAvailable" : 1,
"poolCreated" : 1,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"NetworkInterfaceASIO-TaskExecutorPool-1" : {
"poolInUse" : 0,
"poolAvailable" : 1,
"poolCreated" : 1,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
}
},
"hosts" : {
"localhost:27023" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27024" : {
"inUse" : 0,
"available" : 7,
"created" : 7,
"refreshing" : 0
},
"localhost:27022" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27018" : {
"inUse" : 0,
"available" : 2,
"created" : 2,
"refreshing" : 0
},
"localhost:27020" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27019" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"replicaSets" : {
"shard02" : {
"hosts" : [
{
"addr" : "localhost:27021",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27022",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27023",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
}
]
},
"configRepl" : {
"hosts" : [
{
"addr" : "localhost:27024",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
}
]
},
"shard01" : {
"hosts" : [
{
"addr" : "localhost:27018",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27019",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27020",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
}
]
}
},
"ok" : 1,
"operationTime" : Timestamp(1556553139, 10),
"$clusterTime" : {
"clusterTime" : Timestamp(1556553139, 10),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
MongoDB shell version v0.0.0
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("64963959-3554-47f0-8c7f-5fd73104798f") }
MongoDB server version: 4.0.6
WARNING: shell and server versions do not match
{
"numClientConnections" : 7,
"numAScopedConnections" : 0,
"totalInUse" : 0,
"totalAvailable" : 12,
"totalCreated" : 12,
"totalRefreshing" : 0,
"pools" : {
"NetworkInterfaceTL-ShardRegistry" : {
"poolInUse" : 0,
"poolAvailable" : 3,
"poolCreated" : 3,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 3,
"created" : 3,
"refreshing" : 0
}
},
"NetworkInterfaceTL-TaskExecutorPool-0" : {
"poolInUse" : 0,
"poolAvailable" : 2,
"poolCreated" : 2,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27018" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"global" : {
"poolInUse" : 0,
"poolAvailable" : 7,
"poolCreated" : 7,
"poolRefreshing" : 0,
"localhost:27023" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27024" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27022" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27018" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27020" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27019" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
}
},
"hosts" : {
"localhost:27023" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27024" : {
"inUse" : 0,
"available" : 5,
"created" : 5,
"refreshing" : 0
},
"localhost:27022" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27018" : {
"inUse" : 0,
"available" : 2,
"created" : 2,
"refreshing" : 0
},
"localhost:27020" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27019" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"replicaSets" : {
"shard02" : {
"hosts" : [
{
"addr" : "localhost:27021",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27022",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27023",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
}
]
},
"configRepl" : {
"hosts" : [
{
"addr" : "localhost:27024",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
}
]
},
"shard01" : {
"hosts" : [
{
"addr" : "localhost:27018",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27019",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
},
{
"addr" : "localhost:27020",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 0
}
]
}
},
"ok" : 1,
"operationTime" : Timestamp(1556553229, 10),
"$clusterTime" : {
"clusterTime" : Timestamp(1556553229, 10),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
MongoDB shell version v0.0.0
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("44d9b1b7-fe3b-4359-8614-48350d0837c9") }
MongoDB server version: 0.0.0
{
"numClientConnections" : 0,
"numAScopedConnections" : 0,
"totalInUse" : 0,
"totalAvailable" : 5,
"totalCreated" : 5,
"totalRefreshing" : 0,
"pools" : {
"NetworkInterfaceTL-ShardRegistry" : {
"poolInUse" : 0,
"poolAvailable" : 3,
"poolCreated" : 3,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 3,
"created" : 3,
"refreshing" : 0
}
},
"NetworkInterfaceTL-TaskExecutorPool-0" : {
"poolInUse" : 0,
"poolAvailable" : 2,
"poolCreated" : 2,
"poolRefreshing" : 0,
"localhost:27024" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
}
},
"hosts" : {
"localhost:27024" : {
"inUse" : 0,
"available" : 4,
"created" : 4,
"refreshing" : 0
},
"localhost:27021" : {
"inUse" : 0,
"available" : 1,
"created" : 1,
"refreshing" : 0
}
},
"replicaSets" : {
"shard01" : {
"hosts" : [
{
"addr" : "localhost:27018",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 6
},
{
"addr" : "localhost:27019",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 6
},
{
"addr" : "localhost:27020",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 6
}
]
},
"shard02" : {
"hosts" : [
{
"addr" : "localhost:27021",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 4
},
{
"addr" : "localhost:27022",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 5
},
{
"addr" : "localhost:27023",
"ok" : true,
"ismaster" : false,
"hidden" : false,
"secondary" : true,
"pingTimeMillis" : 5
}
]
},
"configRepl" : {
"hosts" : [
{
"addr" : "localhost:27024",
"ok" : true,
"ismaster" : true,
"hidden" : false,
"secondary" : false,
"pingTimeMillis" : 2
}
]
}
},
"ok" : 1,
"operationTime" : Timestamp(1556553465, 3),
"$clusterTime" : {
"clusterTime" : Timestamp(1556553465, 3),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment