Atlas Query Profiler helps diagnose slow-running queries in a database cluster. In the Atlas UI, its Query Insights tab displays slow operations and performance statistics collected from mongod instances. It is available only for M10 and higher clusters. section 21.2.1
To investigate a slowdown:
- Open Query Insights to view operations across the cluster, or use Host Selector to focus on a shard or an individual node. section 21.2.1
- Set a time frame and filter the results. Compare Operation Execution Time and Server Execution Time in the charts and tables to pinpoint inefficient operations. section 21.2.1
- For collections with slow queries, check Performance Advisor separately for suggested indexes. Its average query targeting score compares documents read with documents returned; a score of 1 indicates that every document read was returned. section 21.2.1
atlas performanceAdvisor slowQueryLogs list \
--processName atlas-rr5vne-shard-00-00.a7niyd4.mongodb.net:27017
The Atlas CLI can retrieve slow-query log entries identified by Performance Advisor and Query Profiler. Supply a process name for the node you want to examine. section 21.2.1
Use Query Profiler to narrow down where and when slow operations occur; use the log entries and Performance Advisor recommendations to investigate possible improvements. Rechecking these signals regularly can reveal performance problems before they affect users. section 21.2.1 section 21.5
