- Reference >
- Database Commands >
- Diagnostic Commands >
- connPoolStats
connPoolStats¶
On this page
Definition¶
- connPoolStats¶
The command connPoolStats returns information regarding the number of open connections to the current database instance, including client connections and server-to-server connections for replication and clustering.
Note
connPoolStats only returns meaningful results for mongos instances and for mongod instances in sharded clusters.
The command takes the following form:
{ connPoolStats: 1 }
The value of the argument (i.e. 1 ) does not affect the output of the command.
Output¶
- connPoolStats.hosts¶
The embedded documents of the hosts document report connections between the mongos or mongod instance and each component mongod of the sharded cluster.
- connPoolStats.replicaSets¶
replicaSets is a document that contains replica set information for the sharded cluster.
- connPoolStats.replicaSets.shard¶
The shard document reports on each shard within the sharded cluster
- connPoolStats.replicaSets.[shard].host¶
The host field holds an array of document that reports on each host within the shard in the replica set.
These values derive from the replica set status values.
- connPoolStats.replicaSets.[shard].host[n].addr¶
addr reports the address for the host in the sharded cluster in the format of “[hostname]:[port]”.
- connPoolStats.replicaSets.[shard].host[n].ok¶
ok reports false when:
- the mongos or mongod cannot connect to instance.
- the mongos or mongod received a connection exception or error.
This field is for internal use.
- connPoolStats.replicaSets.[shard].host[n].ismaster¶
ismaster reports true if this host is the primary member of the replica set.
hidden reports true if this host is a hidden member of the replica set.
- connPoolStats.replicaSets.[shard].host[n].secondary¶
secondary reports true if this host is a secondary member of the replica set.
- connPoolStats.replicaSets.[shard].host[n].pingTimeMillis¶
pingTimeMillis reports the ping time in milliseconds from the mongos or mongod to this host.
New in version 2.2.
tags reports the members[n].tags, if this member of the set has tags configured.
- connPoolStats.replicaSets.[shard].master¶
master reports the ordinal identifier of the host in the host array that is the primary of the replica set.
- connPoolStats.replicaSets.[shard].nextSlave¶
Deprecated since version 2.2.
nextSlave reports the secondary member that the mongos will use to service the next request for this replica set.
- connPoolStats.createdByType¶
createdByType document reports the number of each type of connection that mongos or mongod has created in all connection pools.
mongos connect to mongod instances using one of three types of connections. The following embedded document reports the total number of connections by type.
- connPoolStats.createdByType.master¶
master reports the total number of connections to the primary member in each cluster.
- connPoolStats.createdByType.set¶
set reports the total number of connections to a replica set member.
- connPoolStats.createdByType.sync¶
sync reports the total number of config database connections.
- connPoolStats.totalAvailable¶
totalAvailable reports the running total of connections from the mongos or mongod to all mongod instances in the sharded cluster available for use.
- connPoolStats.totalCreated¶
totalCreated reports the total number of connections ever created from the mongos or mongod to all mongod instances in the sharded cluster.
- connPoolStats.numDBClientConnection¶
numDBClientConnection reports the total number of connections from the mongos or mongod to all of the mongod instances in the sharded cluster.
Thank you for your feedback!
We're sorry! You can Report a Problem to help us improve this page.