/
connPoolStats.txt
187 lines (123 loc) · 6.95 KB
/
connPoolStats.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
=============
connPoolStats
=============
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. dbcommand:: connPoolStats
The command :dbcommand:`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.
.. include:: /includes/note-conn-pool-stats.rst
The command takes the following form:
.. code-block:: javascript
{ connPoolStats: 1 }
The value of the argument (i.e. ``1`` ) does not affect the
output of the command.
Output
------
.. data:: connPoolStats.hosts
The sub-documents of the :data:`~connPoolStats.hosts` :term:`document` report connections
between the :binary:`~bin.mongos` or :binary:`~bin.mongod` instance and each component
:binary:`~bin.mongod` of the :term:`sharded cluster`.
.. data:: connPoolStats.hosts.[host].available
:data:`~connPoolStats.hosts.[host].available` reports the total number of
connections that the :binary:`~bin.mongos` or :binary:`~bin.mongod`
could use to connect to this :binary:`~bin.mongod`.
.. data:: connPoolStats.hosts.[host].created
:data:`~connPoolStats.hosts.[host].created` reports the number of connections
that this :binary:`~bin.mongos` or :binary:`~bin.mongod` has ever created for this host.
.. data:: connPoolStats.replicaSets
:data:`~connPoolStats.replicaSets` is a :term:`document` that contains
:term:`replica set` information for the :term:`sharded cluster`.
.. data:: connPoolStats.replicaSets.shard
The :data:`~connPoolStats.replicaSets.shard` :term:`document` reports
on each :term:`shard` within the :term:`sharded cluster`
.. data:: connPoolStats.replicaSets.[shard].host
The :data:`~connPoolStats.replicaSets.[shard].host` field holds an array of
:term:`document` that reports on each host within the
:term:`shard` in the :term:`replica set`.
These values derive from the :doc:`replica set status
</reference/command/replSetGetStatus>` values.
.. data:: connPoolStats.replicaSets.[shard].host[n].addr
:data:`~connPoolStats.replicaSets.[shard].host[n].addr` reports the address
for the host in the :term:`sharded cluster` in the format of
"``[hostname]:[port]``".
.. data:: connPoolStats.replicaSets.[shard].host[n].ok
:data:`~connPoolStats.replicaSets.[shard].host[n].ok` reports ``false``
when:
- the :binary:`~bin.mongos` or :binary:`~bin.mongod` cannot connect
to instance.
- the :binary:`~bin.mongos` or :binary:`~bin.mongod` received a
connection exception or error.
This field is for internal use.
.. data:: connPoolStats.replicaSets.[shard].host[n].ismaster
:data:`~connPoolStats.replicaSets.[shard].host[n].ismaster` reports ``true``
if this :data:`~connPoolStats.replicaSets.[shard].host` is the
:term:`primary` member of the :term:`replica set`.
.. data:: connPoolStats.replicaSets.[shard].host[n].hidden
:data:`~connPoolStats.replicaSets.[shard].host[n].hidden` reports ``true``
if this :data:`~connPoolStats.replicaSets.[shard].host` is a :term:`hidden
member` of the :term:`replica set`.
.. data:: connPoolStats.replicaSets.[shard].host[n].secondary
:data:`~connPoolStats.replicaSets.[shard].host[n].secondary` reports
``true`` if this :data:`~connPoolStats.replicaSets.[shard].host` is a
:term:`secondary` member of the :term:`replica set`.
.. data:: connPoolStats.replicaSets.[shard].host[n].pingTimeMillis
:data:`~connPoolStats.replicaSets.[shard].host[n].pingTimeMillis` reports
the ping time in milliseconds from the :binary:`~bin.mongos` or
:binary:`~bin.mongod` to this :data:`~connPoolStats.replicaSets.[shard].host`.
.. data:: connPoolStats.replicaSets.[shard].host[n].tags
.. versionadded:: 2.2
:data:`~connPoolStats.replicaSets.[shard].host[n].tags` reports the
:data:`~local.system.replset.members[n].tags`, if this member of the set has tags
configured.
.. data:: connPoolStats.replicaSets.[shard].master
:data:`~connPoolStats.replicaSets.[shard].master` reports the ordinal identifier
of the host in the :data:`~connPoolStats.replicaSets.[shard].host` array that is
the :term:`primary` of the :term:`replica set`.
.. data:: connPoolStats.replicaSets.[shard].nextSlave
.. deprecated:: 2.2
:data:`~connPoolStats.replicaSets.[shard].nextSlave` reports the
:term:`secondary` member that the :binary:`~bin.mongos` will use to
service the next request for this :term:`replica set`.
.. data:: connPoolStats.createdByType
:data:`~connPoolStats.createdByType` :term:`document` reports the number of each
type of connection that :binary:`~bin.mongos` or :binary:`~bin.mongod` has created in all
connection pools.
:binary:`~bin.mongos` connect to :binary:`~bin.mongod` instances using one
of three types of connections. The following sub-document reports
the total number of connections by type.
.. data:: connPoolStats.createdByType.master
:data:`~connPoolStats.createdByType.master` reports the total number of
connections to the :term:`primary` member in each :term:`cluster`.
.. data:: connPoolStats.createdByType.set
:data:`~connPoolStats.createdByType.set` reports the total number of
connections to a :term:`replica set` member.
.. data:: connPoolStats.createdByType.sync
:data:`~connPoolStats.createdByType.sync` reports the total number of
:term:`config database` connections.
.. data:: connPoolStats.totalAvailable
:data:`~connPoolStats.totalAvailable` reports the running total of connections
from the :binary:`~bin.mongos` or :binary:`~bin.mongod` to all :binary:`~bin.mongod` instances in
the :term:`sharded cluster` available for use.
.. data:: connPoolStats.totalCreated
:data:`~connPoolStats.totalCreated` reports the total number of connections ever
created from the :binary:`~bin.mongos` or :binary:`~bin.mongod` to all :binary:`~bin.mongod`
instances in the :term:`sharded cluster`.
.. data:: connPoolStats.numDBClientConnection
:data:`~connPoolStats.numDBClientConnection` reports the total number of
connections from the :binary:`~bin.mongos` or :binary:`~bin.mongod` to all of the :binary:`~bin.mongod`
instances in the :term:`sharded cluster`.
.. data:: connPoolStats.numAScopedConnection
:data:`~connPoolStats.numAScopedConnection` reports the number of exception safe
connections created from :binary:`~bin.mongos` or :binary:`~bin.mongod` to all :binary:`~bin.mongod`
in the :term:`sharded cluster`. The :binary:`~bin.mongos` or :binary:`~bin.mongod` releases these
connections after receiving a socket exception from the
:binary:`~bin.mongod`.