Skip to content

Commit 9bd116f

Browse files
jason-price-mongodbandf-mongodb
authored andcommitted
DOCS-14139 Add server status metrics to cursor
1 parent 85172fb commit 9bd116f

File tree

3 files changed

+87
-41
lines changed

3 files changed

+87
-41
lines changed

source/includes/extracts-server-status-projection-base.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ content: |
3838
:serverstatus:`readConcernCounters` to track use of read concern
3939
levels specified by query operations
4040
41+
- Added new metric to track number of incoming connections:
42+
43+
- :serverstatus:`connections.threaded`
44+
45+
- Added new metric to track resharding operations:
46+
47+
- :serverstatus:`shardingStatistics.resharding`
48+
49+
- Added new metric to track service executors:
50+
51+
- :serverstatus:`network.serviceExecutors`
52+
53+
- Added new metrics to track cursors:
54+
55+
- :serverstatus:`metrics.cursor.moreThanOneBatch`
56+
57+
- :serverstatus:`metrics.cursor.totalOpened`
58+
4159
- Starting in MongoDB 4.4, {{operationName}}:
4260
4361
- Added new metrics to track write concern failures caused

source/reference/command/serverStatus.txt

Lines changed: 59 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,9 @@ extra_info
674674
with limited memory environments and larger data sets. Limited and
675675
sporadic page faults do not necessarily indicate an issue.
676676

677-
Windows draws a distinction between "hard" page faults involving
678-
disk I/O, and "soft" page faults that only require moving pages in
679-
memory. MongoDB counts both hard and soft page faults in this
680-
statistic.
677+
Windows differentiates "hard" page faults involving disk I/O from
678+
"soft" page faults that only require moving pages in memory. MongoDB
679+
counts both hard and soft page faults in this statistic.
681680

682681
.. _server-status-flowControl:
683682

@@ -713,7 +712,7 @@ flowControl
713712
.. serverstatus:: flowControl.enabled
714713

715714
A boolean that indicates whether :ref:`flow-control` is
716-
enabled(``true``) or disabled (``false``).
715+
enabled (``true``) or disabled (``false``).
717716

718717
See also :parameter:`enableFlowControl`.
719718

@@ -893,8 +892,8 @@ globalLock
893892
.. serverstatus:: globalLock.totalTime
894893

895894
The time, in microseconds, since the database last started and
896-
created the :serverstatus:`globalLock`. This is roughly equivalent
897-
to total server uptime.
895+
created the :serverstatus:`globalLock`. This is approximately
896+
equivalent to the total server uptime.
898897

899898
.. serverstatus:: globalLock.currentQueue
900899

@@ -915,13 +914,13 @@ globalLock
915914
.. serverstatus:: globalLock.currentQueue.readers
916915

917916
The number of operations that are currently queued and waiting for
918-
the read lock. A consistently small read-queue, particularly of
917+
the read lock. A consistently small read queue, particularly of
919918
shorter operations, should cause no concern.
920919

921920
.. serverstatus:: globalLock.currentQueue.writers
922921

923922
The number of operations that are currently queued and waiting for
924-
the write lock. A consistently small write-queue, particularly of
923+
the write lock. A consistently small write queue, particularly of
925924
shorter operations, is no cause for concern.
926925

927926
.. serverstatus:: globalLock.activeClients
@@ -1032,7 +1031,7 @@ latchAnalysis
10321031
.. serverstatus:: latchAnalysis
10331032

10341033
A document that reports on metrics related to internal locking
1035-
primitives (a.k.a. latches).
1034+
primitives (also known as latches).
10361035

10371036
To return :serverstatus:`latchAnalysis` information, you must
10381037
explicitly specify the inclusion:
@@ -1348,24 +1347,24 @@ network
13481347
.. serverstatus:: network
13491348

13501349
A document that reports data on MongoDB's network use. These
1351-
statistics measure *ingress connections* only, i.e. traffic
1352-
seen by the :binary:`~bin.mongod` / :binary:`~bin.mongos` over
1353-
network connections initiated by clients or other
1354-
:binary:`~bin.mongod` / :binary:`~bin.mongos` instances. Traffic from
1355-
network connections initiated by this :binary:`~bin.mongod` /
1356-
:binary:`~bin.mongos` instance (i.e. *egress connections*) is *not*
1357-
measured in these statistics.
1350+
statistics measure *ingress connections* only, specifically the
1351+
traffic seen by the :binary:`~bin.mongod` or :binary:`~bin.mongos`
1352+
over network connections initiated by clients or other
1353+
:binary:`~bin.mongod` or :binary:`~bin.mongos` instances. Traffic
1354+
from network connections initiated by this :binary:`~bin.mongod` or
1355+
:binary:`~bin.mongos` instance (specifically, *egress connections*)
1356+
is *not* measured in these statistics.
13581357

13591358
.. serverstatus:: network.bytesIn
13601359

13611360
The total number of bytes that the server has *received* over network
1362-
connections initiated by clients or other :binary:`~bin.mongod` /
1361+
connections initiated by clients or other :binary:`~bin.mongod` or
13631362
:binary:`~bin.mongos` instances.
13641363

13651364
.. serverstatus:: network.bytesOut
13661365

13671366
The total number of bytes that the server has *sent* over network
1368-
connections initiated by clients or other :binary:`~bin.mongod` /
1367+
connections initiated by clients or other :binary:`~bin.mongod` or
13691368
:binary:`~bin.mongos` instances.
13701369

13711370
.. serverstatus:: network.numSlowDNSOperations
@@ -1439,8 +1438,8 @@ network
14391438
.. versionadded:: 4.4
14401439

14411440
The total number of accepted incoming TCP Fast Open (TFO) connections
1442-
to the :binary:`~bin.mongod` / :binary:`~bin.mongos` since the
1443-
``mongod / mongos`` last started.
1441+
to the :binary:`~bin.mongod` or :binary:`~bin.mongos` since the
1442+
``mongod`` or ``mongos`` last started.
14441443

14451444
.. serverstatus:: network.serviceExecutors
14461445

@@ -1611,13 +1610,11 @@ opReadConcernCounters
16111610
- Number of query operations that specified read
16121611
concern level :readconcern:`"local"`.
16131612

1614-
16151613
* - ``"majority"``
16161614

16171615
- Number of query operations that specified read
16181616
concern level :readconcern:`"majority"`.
16191617

1620-
16211618
* - ``"snapshot"``
16221619

16231620
- Number of query operations that specified read
@@ -2398,6 +2395,7 @@ repl
23982395
.. serverstatus:: repl.replicationProgress[n].memberID
23992396

24002397
The integer identifier for this member of the replica set.
2398+
24012399
.. _server-status-security:
24022400

24032401
security
@@ -2450,19 +2448,19 @@ security
24502448
A document that reports on:
24512449

24522450
- The number of times a given authentication mechanism has been used
2453-
to authenticate against the
2454-
:binary:`~bin.mongod` / :binary:`~bin.mongos` instance. (New in MongoDB 4.4)
2451+
to authenticate against the :binary:`~bin.mongod` or
2452+
:binary:`~bin.mongos` instance. (New in MongoDB 4.4)
24552453

24562454
- The :binary:`~bin.mongod`/:binary:`~bin.mongos` instance's TLS/SSL
2457-
certificate. (Only appears for :binary:`~bin.mongod` /
2455+
certificate. (Only appears for :binary:`~bin.mongod` or
24582456
:binary:`~bin.mongos` instance with support for TLS)
24592457

24602458
.. serverstatus:: security.authentication.mechanisms
24612459

24622460
A document that reports on the number of times a given
24632461
authentication mechanism has been used to authenticate against the
2464-
:binary:`~bin.mongod`/:binary:`~bin.mongos` instance. The values
2465-
in the document distinguish standard authentication and
2462+
:binary:`~bin.mongod` or :binary:`~bin.mongos` instance. The
2463+
values in the document distinguish standard authentication and
24662464
speculative authentication. [#speculative-auth]_
24672465

24682466
.. versionadded:: 4.4
@@ -2473,7 +2471,7 @@ security
24732471
configuration of the :parameter:`authenticationMechanisms`
24742472
parameter. The ``mechanisms`` document includes a field for
24752473
each authentication mechanism supported by your
2476-
:binary:`~bin.mongod` / :binary:`~bin.mongos` instance.
2474+
:binary:`~bin.mongod` or :binary:`~bin.mongos` instance.
24772475

24782476
The following example shows the shape of the ``mechanisms``
24792477
document for a deployment that only supports :doc:`x.509
@@ -2484,7 +2482,7 @@ security
24842482
A document that reports on the number of times
24852483
:doc:`x.509 </core/security-x.509/>` has been used to
24862484
authenticate against the
2487-
:binary:`~bin.mongod` / :binary:`~bin.mongos` instance.
2485+
:binary:`~bin.mongod` or :binary:`~bin.mongos` instance.
24882486

24892487
Includes total number of ``x.509`` authentication attempts and the
24902488
subset of those attempts which were speculative.
@@ -2755,7 +2753,7 @@ shardingStatistics
27552753

27562754
To calculate the duration of the catch-up phase, subtract
27572755
:serverstatus:`~shardingStatistics.totalCriticalSectionCommitTimeMillis` from
2758-
:serverstatus:`~shardingStatistics.totalCriticalSectionTimeMillis`
2756+
:serverstatus:`~shardingStatistics.totalCriticalSectionTimeMillis`:
27592757

27602758
.. code-block:: none
27612759

@@ -3704,7 +3702,7 @@ transactions
37043702

37053703
|mongos-only|
37063704

3707-
Breakdown of the commits by types. For example:
3705+
Breakdown of the commits by types. For example:
37083706

37093707
.. code-block:: javascript
37103708
:copyable: false
@@ -3754,6 +3752,7 @@ transactions
37543752
- Commits of transactions that did not contact any shards.
37553753

37563754
* - ``singleShard``
3755+
37573756
- Commits of transactions that affected a single shard.
37583757

37593758
* - ``singleWriteShard``
@@ -4578,13 +4577,15 @@ metrics
45784577
}
45794578
},
45804579
"cursor" : {
4580+
"moreThanOneBatch" : NumberLong(<num>),
45814581
"timedOut" : NumberLong(<num>),
4582+
"totalOpened" : NumberLong(<num>),
45824583
"open" : {
45834584
"noTimeout" : NumberLong(<num>),
45844585
"pinned" : NumberLong(<num>),
45854586
"multiTarget" : NumberLong(<num>),
45864587
"singleTarget" : NumberLong(<num>),
4587-
"total" : NumberLong(<num>),
4588+
"total" : NumberLong(<num>)
45884589
}
45894590
},
45904591
"document" : {
@@ -4600,7 +4601,7 @@ metrics
46004601
},
46014602
"wtimeouts" : NumberLong(<num>),
46024603
"default" : {
4603-
"unsatisfiable" : <num>
4604+
"unsatisfiable" : <num>,
46044605
"wtimeouts" : <num>
46054606
}
46064607
},
@@ -4648,7 +4649,7 @@ metrics
46484649
"initialSync" : {
46494650
"completed" : <NumberLong>,
46504651
"failedAttempts" : <NumberLong>,
4651-
"failures" : <NumberLong>,
4652+
"failures" : <NumberLong>
46524653
},
46534654
"network" : {
46544655
"bytes" : <NumberLong>,
@@ -4957,7 +4958,7 @@ metrics
49574958
oplog application process on :term:`secondaries <secondary>`
49584959
members of replica sets. See
49594960
:ref:`replica-set-internals-multi-threaded-replication` for more
4960-
information on the oplog application processes
4961+
information on the oplog application processes.
49614962

49624963
.. serverstatus:: metrics.repl.apply.batches.num
49634964

@@ -5211,7 +5212,7 @@ metrics
52115212
.. serverstatus:: metrics.storage.freelist.search.bucketExhausted
52125213

52135214
The number of times that :binary:`~bin.mongod` has examined the free
5214-
list without finding a suitably large record allocation.
5215+
list without finding a large record allocation.
52155216

52165217
.. serverstatus:: metrics.storage.freelist.search.requests
52175218

@@ -5244,12 +5245,29 @@ metrics
52445245

52455246
A document that contains data regarding cursor state and use.
52465247

5248+
.. serverstatus:: metrics.cursor.moreThanOneBatch
5249+
5250+
The total number of cursors that have returned more than one batch
5251+
since the server process started. Additional batches are retrieved
5252+
using the :dbcommand:`getMore` command.
5253+
5254+
.. versionadded:: 5.0
5255+
52475256
.. serverstatus:: metrics.cursor.timedOut
52485257

52495258
The total number of cursors that have timed out since the server
52505259
process started. If this number is large or growing at a regular
52515260
rate, this may indicate an application error.
52525261

5262+
.. serverstatus:: metrics.cursor.totalOpened
5263+
5264+
The total number of cursors that have been opened since the server
5265+
process started, including cursors currently open. Differs from
5266+
:serverstatus:`metrics.cursor.open.total`, which is the number of
5267+
currently open cursors only.
5268+
5269+
.. versionadded:: 5.0
5270+
52535271
.. serverstatus:: metrics.cursor.open
52545272

52555273
A document that contains data regarding open cursors.
@@ -5268,8 +5286,8 @@ metrics
52685286

52695287
The number of cursors that MongoDB is maintaining for clients.
52705288
Because MongoDB exhausts unused cursors, typically this value small
5271-
or zero. However, if there is a queue, stale tailable cursors, or a
5272-
large number of operations this value may rise.
5289+
or zero. However, if there is a queue, or stale tailable cursors, or
5290+
a large number of operations this value may increase.
52735291

52745292
.. serverstatus:: metrics.cursor.open.singleTarget
52755293

@@ -5319,8 +5337,8 @@ watchdog
53195337

53205338
.. serverstatus:: watchdog.monitorPeriod
53215339

5322-
The value set by :parameter:`watchdogPeriodSeconds`. This represents the
5323-
period in between status checks.
5340+
The value set by :parameter:`watchdogPeriodSeconds`. This is the
5341+
period between status checks.
53245342

53255343
Output Changelog
53265344
----------------

source/release-notes/5.0.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,16 @@ output:
249249
on the service executors that run operations for client
250250
requests
251251

252+
Cursor Metrics
253+
.. list-table::
254+
255+
* - | :serverstatus:`metrics.cursor.moreThanOneBatch`, which
256+
reports the total number of cursors that have returned
257+
more than one batch (additional batches are retrieved
258+
using the :dbcommand:`getMore` command)
259+
| :serverstatus:`metrics.cursor.totalOpened`, which reports
260+
the total number of cursors that have been opened
261+
252262
Additional ``dbStats`` Free Space Statistics
253263
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
254264

0 commit comments

Comments
 (0)