Currently the mongos collects the opcounter metrics etc, with which we can get an idea on the incoming operations to the mongos. The mongos dispatch the operations to the shards:
- If the operation only targets one shard, then the mongos only needs to dispatch it to one shard.
- However, if the operation is a scatter-gather operation or targets a sub set of shards, then the mongos would need to dispatch the operation to multiple shards. In this case, the mongos is doing more work for such operation than the targeted operation, and there would be more load on the mongos.
Currently we have added a metric to indicate the amount of sharded updates done with only _id in query (
SERVER-41184). It would be nice to expose the number of shards targeted for the operations (find, aggregate, etc), so that we can have some insight on the number of outgoing operations from the mongos, to understand the (outgoing) workload on the mongos.
- is documented by
DOCS-14455 Investigate changes in SERVER-43617: Add metrics on the mongos to indicate the number of shards targeted for the commands (find, aggregate, etc)
- is duplicated by
SERVER-37782 Would like server stats in mongos on scatter-gather queries