Docs Menu
Docs Home
/ /

Profile Slow Queries

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.

The Ops Manager Profiler page displays profiling data for slow queries on your databases. The Profiler recognizes a query as slow if it takes longer to execute than the slow query threshold set for your mongod instance.

The Ops Manager Profiler identifies slow queries by tailing slow query log data from your mongod instances. Ops Manager displays this data on a process's Profiler page. To view the Profiler page for a process, click the process in the Deployment view and then click the Profiler tab.

The Profiler page displays a chart and a table that describe metrics for the profiled database operations. To improve the performance of slow operations, you can use the Performance Advisor to suggest indexes for your databases.

Note

The Ops Manager Profiler is different than the MongoDB database profiler, which collects data about database commands executed against a running mongod instance and writes data to the system.profile collection.

The Ops Manager Profiler is controlled by a project-level setting, which determines whether Ops Manager agents tail the slow query and send them to Ops Manager, and whether the Performance Advisor and Profiler pages are available for that project. The Ops Manager Profiler does not write to the system.profile collection.

Important

Read the following considerations before you enable Ops Manager 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 Ops Manager 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.

As of Ops Manager version 4.4, Ops Manager enables the Ops Manager Profiler by default. 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. To change the threshold, see Configure the Slow Query Threshold.

To disable the Ops Manager Profiler for an Ops Manager project, navigate to the project settings and toggle the Performance Advisor and Profiler setting to On or Off. This stops Ops Manager from tailing the mongod logs for slow query data, and disables the Performance Advisor and Profiler pages for that project.

The Performance Advisor and Profiler setting doesn't affect whether the MongoDB database profiler is enabled on a given mongod process, only whether Ops Manager collects and displays profiling data for slow queries.

The Ops Manager Profiler page contains two displays for database profile information: a chart and a table. The following sections describe how to filter the data in each display.

You can filter the Profiler chart by metric and time period. To filter the chart:

  1. From the Display drop-down menu, select the metric you want to view in the chart. Available options are:

    • Operation Execution Time (default)

    • Keys Examined

    • Docs Returned

    • Examined:Returned Ratio

    • Num Yields

    • Response Length

  2. From the View Last drop-down menu, select the time period you want to view in the chart. Available options are:

    • 24 hr (default)

    • 12 hr

    • 6 hr

    • 1 hr

    • 15 min

You can filter the Profiler table by namespace, operation type, and metric. To filter the table:

  1. From the All Namespaces drop-down, choose which database and collections to profile in the table.

  2. From the All Operations drop-down, choose which operation types to profile.

  3. From the Operation Execution Time drop-down, choose which metric you want to profile. Available options are:

    • Operation Execution Time (default)

    • Keys Examined

    • Docs Returned

    • Examined:Returned Ratio

    • Num Yields

    • Response Length

Back

Review Index Recommendations

On this page