Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS-14455 Add references for numHosts targeted in shardingStatistics #5845

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions source/includes/fact-server-status-num-hosts-targeted.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. list-table::
:header-rows: 1
:widths: 20 40

* - Name
- Description

* - ``allShards``
- A command targeted all shards

* - ``manyShards``
- A command targeted more than one shard

* - ``oneShard``
- A command targeted one shard

* - ``unsharded``
- A command was run on an unsharded collection
56 changes: 56 additions & 0 deletions source/reference/command/serverStatus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2774,6 +2774,39 @@ shardingStatistics
.. code-block:: javascript

"shardingStatistics" : {
"numHostsTargeted": {
"find" : {
"allShards": NumberLong(<num>),
"manyShards": NumberLong(<num>),
"oneShard": NumberLong(<num>),
"unsharded": NumberLong(<num>)
},
"insert": {
"allShards": NumberLong(<num>),
"manyShards": NumberLong(<num>),
"oneShard": NumberLong(<num>),
"unsharded": NumberLong(<num>)
},
"update": {
"allShards": NumberLong(<num>),
"manyShards": NumberLong(<num>),
"oneShard": NumberLong(<num>),
"unsharded": NumberLong(<num>)
},
"delete": {
"allShards": NumberLong(<num>),
"manyShards": NumberLong(<num>),
"oneShard": NumberLong(<num>),
"unsharded": NumberLong(<num>)
},
"aggregate": {
"allShards": NumberLong(<num>),
"manyShards": NumberLong(<num>),
"oneShard": NumberLong(<num>),
"unsharded": NumberLong(<num>)
}
}
},
"catalogCache" : {
"numDatabaseEntries" : NumberLong(<num>),
"numCollectionEntries" : NumberLong(<num>),
Expand Down Expand Up @@ -3364,6 +3397,29 @@ shardingStatistics

.. versionadded:: 5.0

.. serverstatus:: shardingStatistics.numHostsTargeted

Indicates the number of shards targeted for ``CRUD`` operations and
aggregation commands. When a ``CRUD`` operation or aggregation
command is run, the following metrics will be incremented.

.. include:: /includes/fact-server-status-num-hosts-targeted.rst

.. note::

Running the :dbcommand:`serverStatus` command on :binary:`mongos`
will provide insight into the CRUD and aggregation operations that
run on a sharded cluster.

Multi-shard operations can either be
:ref:`scatter-gather<sharding-query-patterns>`
or shard specific. Multi-shard scatter-gather operations can
:ref:`consume more resources<sharding-troubleshooting-scatter-gather>`.
By using the
:serverstatus:`shardingStatistics.numHostsTargeted`
metrics you can tune the aggregation queries that run on a
sharded cluster.

.. serverstatus:: shardingStatistics.resharding.coordinatorState

State of the resharding coordinator for the current :ref:`resharding
Expand Down
10 changes: 10 additions & 0 deletions source/release-notes/4.4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,16 @@ output:
- :serverstatus:`shardedIndexConsistency`
- :serverstatus:`shardingStatistics.rangeDeleterTasks`
- :serverstatus:`shardingStatistics.unfinishedMigrationFromPreviousPrimary`
- :serverstatus:`shardingStatistics.numHostsTargeted`

``serverStatus`` Sharding Statistics Output Change
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:serverstatus:`shardingStatistics.numHostsTargeted`
which reports the number of shards targeted by CRUD operations and
aggregation commands. The relevant find, insert, update, delete or
aggregate metric will be incremented with each operation on a
cluster.

``replSetGetStatus`` Output Change
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down