liveBook · Manning

Atlas Query Profiler

As explained in MongoDB 8.0 in Action, Third Edition

Atlas Query Profiler is an Atlas monitoring feature that analyzes query activity and performance statistics to identify slow-running queries.

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

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Explains UI views, host and time-frame filtering, and execution metrics, but does not detail profiler internals.
Examples
Shows an Atlas CLI command for retrieving slow-query logs from a named process.
What you can do after
Apply it via the Atlas UI to isolate slow operations by host and time frame and inspect their execution statistics.
How it connects
Connects slow-query diagnosis to Performance Advisor, suggested indexes, and slow-query logs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of MongoDB 8.0 in Action, Third Edition. The section links point to the parts of the book it draws on.