Docs Menu
Docs Home
/
MongoDB Ops Manager
/ /

Profile Databases

On this page

  • Considerations
  • Enable Profiling
  • Profiler Interface

Note

Available only with the MongoDB Agent with Automation

This feature is available only with the MongoDB Agent with Automation. To learn more about the MongoDB Agent with Automation, see Add Existing MongoDB Processes to Ops Manager.

A database profiler gathers statistics about writes, cursors, and commands on one running mongod instance.

Ops Manager can collect and display statistics from any of your mongod instances. The Query Profiler identifies slow queries based on log data from your mongod instances. Ops Manager displays this data on an instance's Profiler page. To access an instance's metrics, click the Metrics button for that instance.

The Profiler displays one aspect, like Operation Execution Time, that could 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. The Profiler suggests indexes for your databases to improve the performance of slow operations.

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 Ops Manager is consistent with your information security practices.

The Query Profiler displays up to the limit that it reaches first:

  • The most recent 10,000 operations, or

  • The most recent 10MB of logs.

Monitoring tries to minimize its effect on the monitored systems. If polling profile data slows database performance, Ops Manager throttles how often it collects data.

Ops Manager 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 real time.

With profiling enabled, configuration changes made in Ops Manager can take up to 2 minutes to propagate to the agent and 1 more minute before profiling data appears in the Ops Manager interface.

Ops Manager performs a rolling restart of the mongod processes in your cluster when you enable or disable database profiling. If your cluster is a replica set, a replica set election occurs as a byproduct of the restart. This one-time operation is in addition to the time required to propogate configuration changes to the Automation.

As of Ops Manager version 4.4, Ops Manager always enables profiling. Your mongod instance collects profile data for operations longer than the slow operation threshold and reports them to Ops Manager. The threshold for slow operations applies to the entire mongod instance. Ops Manager defaults this threshold to 100 ms.

The Profiler has two sections to the page that display database profile information: a chart and a table. Each can display different data.

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

  1. Select the metric from the Display menu. Accepted options are:

    • Operation Execution Time (default)

    • Keys Examined

    • Docs Returned

    • Examined:Returned Ratio

    • Num Yields

    • Response Length

  2. Select the time period from the View Last menu. Accepted options are:

    • 24 hr (default)

    • 12 hr

    • 6 hr

    • 1 hr

    • 15 min

To change the slow operations threshold:

  1. Click the Milliseconds button to the right of the For Operations Longer Than label to open the Specify the Threshold for Slow Operations modal.

  2. Change the Set the Threshold for Slow Operations to your desired number of milliseconds.

  3. Click Apply if you want to change the threshold. Click Cancel to close the modal without changing the threshold.

When you change the threshold, you change it for all databases on the instance.

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 to change which metric you want to profile. Accepted options are:

    • Operation Execution Time (default)

    • Keys Examined

    • Docs Returned

    • Examined:Returned Ratio

    • Num Yields

    • Response Length

Back

Review Index Recommendations