Docs Menu

Docs HomeMongoDB Atlas

Monitor Query Performance

On this page

  • Considerations
  • Enable and Disable Profiling
  • Profiler Interface

Only available on M10+ clusters and serverless instances

The Query Profiler diagnoses and monitors performance issues. This monitoring can expose slow-running queries and their key performance statistics in the Atlas UI. You can explore a sample of historical queries for up to the last 24 hours without additional cost or performance overhead.

Atlas collects and displays statistics from any of your mongod instances. Atlas displays this data in the Profiler section of an instance. To access the query profiler, click View Monitoring for that instance in the project panel then click Profiler.

Note

Serverless instances

You access the Query Profiler for a serverless instances from the Monitoring tab.

The Profiler displays one aspect, such as Operation Execution Time or Server Execution Time (serverless instances), that could reveal slow database operations over a set time frame. It displays this data in both a chart and a table that each can filter on aspect and time frame.

Atlas manages the threshold for slow operations for each mongod host based on average operation execution time on that host.

Note

To opt out of the Atlas-managed slow operation threshold and instead use a fixed slow query threshold of 100 milliseconds, use the Atlas Administration API. See Disable Managed Slow Operation Threshold. For M0, M2, M5 clusters and serverless instances, Atlas disables the Atlas-managed slow query operation threshold by default and you can't enable it.

Important

Please read the following considerations before you enable profiling.

Profile data may include sensitive information including the content of database queries. Ensure that exposing this data to Atlas is consistent with your information security practices.

The Query Profiler displays up to the first of the following limits:

  • the most recent 10,000 operations, or

  • the most recent 10MB of logs.

Atlas displays no more than 10,000 data points in the Profiler charts.

Log data is processed in batches. Data can be delayed up to five minutes from realtime.

If a cluster experiences an activity spike and generates an extremely large quantity of log messages, Atlas may stop collecting and storing new logs for a period of time.

Note

Log analysis rate limits apply only to the Performance Advisor UI, the Query Profiler UI, and the Access Tracking UI. Downloadable log files are always complete.

Important

Required Privileges

To enable or disable Performance Advisor and Profiler for a project, you must have the Project Owner role for the project or the Organization Owner role on its parent organization.

Atlas enables Profiling by default.

To disable profiling:

  1. Click Project Settings in the left navigation.

  2. Toggle Performance Advisor and Profiler to Off.

Above the chart, select the metric and time period you want to see.

  1. Select the metric from the Display menu. Atlas accepts:

    • Default: Operation Execution Time or Server Execution Time (serverless instances)

    • Keys Examined

    • Docs Returned

    • Examined:Returned Ratio

    • Num Yields

    • Response Length

  2. Select the time period from the View Last menu. Atlas accepts:

    • 24 hr (default)

    • 12 hr

    • 6 hr

    • 1 hr

    • 15 min

To view a full query and its execution statistics, click on the point representing it on the chart.

Above the table, select the namespace, operation type, and metric you wish to profile:

  1. Click All Namespaces to change which combination of databases and collections to profile.

  2. Click All Operations to change which operations you want to profile.

  3. Click Operation Execution Time or Server Execution Time (serverless instances) to change which metric you want to profile. Atlas accepts:

    • Default: Operation Execution Time or Server Execution Time (serverless instances)

    • Keys Examined

    • Docs Returned

    • Examined:Returned Ratio

    • Num Yields

    • Response Length

←  Enable or Disable Performance Advisor for a ProjectMonitor Real-Time Performance →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.