From f1c8c4b6841a94f729739d96241cf4576e005751 Mon Sep 17 00:00:00 2001 From: ian fogelman Date: Wed, 8 Sep 2021 14:30:40 -0400 Subject: [PATCH 1/2] DOCS-14455 Add references for numHosts targeted in shardingStatistics --- .../fact-server-status-num-hosts-targeted.rst | 18 ++++++ source/reference/command/serverStatus.txt | 55 +++++++++++++++++++ source/release-notes/4.4.txt | 12 ++++ 3 files changed, 85 insertions(+) create mode 100644 source/includes/fact-server-status-num-hosts-targeted.rst diff --git a/source/includes/fact-server-status-num-hosts-targeted.rst b/source/includes/fact-server-status-num-hosts-targeted.rst new file mode 100644 index 00000000000..8f675b436ea --- /dev/null +++ b/source/includes/fact-server-status-num-hosts-targeted.rst @@ -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 \ No newline at end of file diff --git a/source/reference/command/serverStatus.txt b/source/reference/command/serverStatus.txt index d06bc7e4671..9d351f19369 100644 --- a/source/reference/command/serverStatus.txt +++ b/source/reference/command/serverStatus.txt @@ -2774,6 +2774,39 @@ shardingStatistics .. code-block:: javascript "shardingStatistics" : { + "numHostsTargeted": { + "find" : { + "allShards": NumberLong(), + "manyShards": NumberLong(), + "oneShard": NumberLong(), + "unsharded": NumberLong() + }, + "insert": { + "allShards": NumberLong(), + "manyShards": NumberLong(), + "oneShard": NumberLong(), + "unsharded": NumberLong() + }, + "update": { + "allShards": NumberLong(), + "manyShards": NumberLong(), + "oneShard": NumberLong(), + "unsharded": NumberLong() + }, + "delete": { + "allShards": NumberLong(), + "manyShards": NumberLong(), + "oneShard": NumberLong(), + "unsharded": NumberLong() + }, + "aggregate": { + "allShards": NumberLong(), + "manyShards": NumberLong(), + "oneShard": NumberLong(), + "unsharded": NumberLong() + } + } + }, "catalogCache" : { "numDatabaseEntries" : NumberLong(), "numCollectionEntries" : NumberLong(), @@ -3364,6 +3397,28 @@ 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` on :binary:`mongos` + will provide insight into the aggregation operations find, + insert, update, delete and aggregate that run on a sharded + cluster. + + Multi-shard operations can either be + :ref:`scatter-gather` + or shard specific. Multi-shard scatter-gather operations can + :ref:`consume more resources`, + 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 diff --git a/source/release-notes/4.4.txt b/source/release-notes/4.4.txt index 0081e3b3a54..d0958cf9373 100644 --- a/source/release-notes/4.4.txt +++ b/source/release-notes/4.4.txt @@ -1915,6 +1915,18 @@ output: - :serverstatus:`shardedIndexConsistency` - :serverstatus:`shardingStatistics.rangeDeleterTasks` - :serverstatus:`shardingStatistics.unfinishedMigrationFromPreviousPrimary` + - :serverstatus:`shardingStatistics.numHostsTargeted` + +``serverStatus`` Sharding Statistics Output Change +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +CRUD Operations and Aggregations + +: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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 16105b6e1b81eda712cb061fe98a77a7eb24afd5 Mon Sep 17 00:00:00 2001 From: ian fogelman Date: Wed, 8 Sep 2021 14:30:40 -0400 Subject: [PATCH 2/2] DOCS-14455 Add references for numHosts targeted in shardingStatistics --- source/reference/command/serverStatus.txt | 27 ++++++++++++----------- source/release-notes/4.4.txt | 2 -- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/source/reference/command/serverStatus.txt b/source/reference/command/serverStatus.txt index 9d351f19369..5222147e02a 100644 --- a/source/reference/command/serverStatus.txt +++ b/source/reference/command/serverStatus.txt @@ -3405,19 +3405,20 @@ shardingStatistics .. include:: /includes/fact-server-status-num-hosts-targeted.rst - .. note:: Running the :dbcommand:`serverStatus` on :binary:`mongos` - will provide insight into the aggregation operations find, - insert, update, delete and aggregate that run on a sharded - cluster. - - Multi-shard operations can either be - :ref:`scatter-gather` - or shard specific. Multi-shard scatter-gather operations can - :ref:`consume more resources`, - by using the - :serverstatus:`shardingStatistics.numHostsTargeted` - metrics you can tune the aggregation queries that run on a - sharded cluster. + .. 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` + or shard specific. Multi-shard scatter-gather operations can + :ref:`consume more resources`. + By using the + :serverstatus:`shardingStatistics.numHostsTargeted` + metrics you can tune the aggregation queries that run on a + sharded cluster. .. serverstatus:: shardingStatistics.resharding.coordinatorState diff --git a/source/release-notes/4.4.txt b/source/release-notes/4.4.txt index d0958cf9373..12b6fda9298 100644 --- a/source/release-notes/4.4.txt +++ b/source/release-notes/4.4.txt @@ -1920,8 +1920,6 @@ output: ``serverStatus`` Sharding Statistics Output Change ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CRUD Operations and Aggregations - :serverstatus:`shardingStatistics.numHostsTargeted` which reports the number of shards targeted by CRUD operations and aggregation commands. The relevant find, insert, update, delete or