- 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 formongos
instances and formongod
instances in sharded clusters.The command takes the following form:
The value of the argument (i.e.
1
) does not affect the output of the command.
Output¶
-
connPoolStats.
hosts
¶ The sub-documents of the
hosts
document report connections between themongos
ormongod
instance and each componentmongod
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
reportsfalse
when:- the
mongos
ormongod
cannot connect to instance. - the
mongos
ormongod
received a connection exception or error.
This field is for internal use.
- the
-
connPoolStats.replicaSets.[shard].host[n].
ismaster
¶ ismaster
reportstrue
if thishost
is the primary member of the replica set.
hidden
reportstrue
if thishost
is a hidden member of the replica set.
-
connPoolStats.replicaSets.[shard].host[n].
secondary
¶ secondary
reportstrue
if thishost
is a secondary member of the replica set.
-
connPoolStats.replicaSets.[shard].host[n].
pingTimeMillis
¶ pingTimeMillis
reports the ping time in milliseconds from themongos
ormongod
to thishost
.
-
-
connPoolStats.replicaSets.[shard].
master
¶ master
reports the ordinal identifier of the host in thehost
array that is the primary of the replica set.
-
connPoolStats.replicaSets.[shard].
nextSlave
¶ Deprecated since version 2.2.
nextSlave
reports the secondary member that themongos
will use to service the next request for this replica set.
-
-
connPoolStats.
createdByType
¶ createdByType
document reports the number of each type of connection thatmongos
ormongod
has created in all connection pools.mongos
connect tomongod
instances using one of three types of connections. The following sub-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 themongos
ormongod
to allmongod
instances in the sharded cluster available for use.
-
connPoolStats.
totalCreated
¶ totalCreated
reports the total number of connections ever created from themongos
ormongod
to allmongod
instances in the sharded cluster.
-
connPoolStats.
numDBClientConnection
¶ numDBClientConnection
reports the total number of connections from themongos
ormongod
to all of themongod
instances in the sharded cluster.
-
connPoolStats.
numAScopedConnection
¶ numAScopedConnection
reports the number of exception safe connections created frommongos
ormongod
to allmongod
in the sharded cluster. Themongos
ormongod
releases these connections after receiving a socket exception from themongod
.