- Reference >
- Database Commands >
- Diagnostic Commands >
- connPoolStats
connPoolStats¶
On this page
Definition¶
-
connPoolStats¶ The command
connPoolStatsreturns 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
connPoolStatsonly returns meaningful results formongosinstances and formongodinstances 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
hostsdocument report connections between themongosormongodinstance and each componentmongodof the sharded cluster.
-
connPoolStats.replicaSets¶ replicaSetsis a document that contains replica set information for the sharded cluster.-
connPoolStats.replicaSets.shard¶ The
sharddocument reports on each shard within the sharded cluster
-
connPoolStats.replicaSets.[shard].host¶ The
hostfield 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¶ addrreports the address for the host in the sharded cluster in the format of “[hostname]:[port]”.
-
connPoolStats.replicaSets.[shard].host[n].ok¶ okreportsfalsewhen:- the
mongosormongodcannot connect to instance. - the
mongosormongodreceived a connection exception or error.
This field is for internal use.
- the
-
connPoolStats.replicaSets.[shard].host[n].ismaster¶ ismasterreportstrueif thishostis the primary member of the replica set.
hiddenreportstrueif thishostis a hidden member of the replica set.
-
connPoolStats.replicaSets.[shard].host[n].secondary¶ secondaryreportstrueif thishostis a secondary member of the replica set.
-
connPoolStats.replicaSets.[shard].host[n].pingTimeMillis¶ pingTimeMillisreports the ping time in milliseconds from themongosormongodto thishost.
-
-
connPoolStats.replicaSets.[shard].master¶ masterreports the ordinal identifier of the host in thehostarray that is the primary of the replica set.
-
connPoolStats.replicaSets.[shard].nextSlave¶ Deprecated since version 2.2.
nextSlavereports the secondary member that themongoswill use to service the next request for this replica set.
-
-
connPoolStats.createdByType¶ createdByTypedocument reports the number of each type of connection thatmongosormongodhas created in all connection pools.mongosconnect tomongodinstances using one of three types of connections. The following sub-document reports the total number of connections by type.-
connPoolStats.createdByType.master¶ masterreports the total number of connections to the primary member in each cluster.
-
connPoolStats.createdByType.set¶ setreports the total number of connections to a replica set member.
-
connPoolStats.createdByType.sync¶ syncreports the total number of config database connections.
-
-
connPoolStats.totalAvailable¶ totalAvailablereports the running total of connections from themongosormongodto allmongodinstances in the sharded cluster available for use.
-
connPoolStats.totalCreated¶ totalCreatedreports the total number of connections ever created from themongosormongodto allmongodinstances in the sharded cluster.
-
connPoolStats.numDBClientConnection¶ numDBClientConnectionreports the total number of connections from themongosormongodto all of themongodinstances in the sharded cluster.
-
connPoolStats.numAScopedConnection¶ numAScopedConnectionreports the number of exception safe connections created frommongosormongodto allmongodin the sharded cluster. Themongosormongodreleases these connections after receiving a socket exception from themongod.