Profile Databases

Available only with Cloud Manager Premium

This feature is available only with Cloud Manager Premium, which comes with certain MongoDB subscriptions. To learn more about Cloud Manager Premium, Contact MongoDB.


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

Cloud Manager can collect and display statistics from any of your mongod instances that have profiling enabled. Cloud Manager displays this data in the Profiler section of an instance’s Metrics page.



Please read the following considerations before enabling profiling.


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

system.profile Collection

The MongoDB profiler stores data in the system.profile collection. This is a capped collection with a 1 MB default size. You may increase the size of this collection up to 4 MB.

When collecting data from the profiler, Cloud Manager ignores data about operations on the system.profile collection, such as Monitoring queries of the system.profile collection.

Resource Consumption Impact

The profiler consumes resources which may slow MongoDB performance. Consider the resource impact before enabling profiling.

Data Collection

Every minute, the agent queries the system.profile collection for the last 20 documents created. The agent sends those documents to Cloud Manager.

See also

Database Profiler in the MongoDB Manual.

Cloud Manager samples profile documents until it samples either all documents returned or 4 MB of returned document data. This 4 MB limit may be reached if you increase the collection’s size to 4 MB and your database creates large profiler documents.

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

Leaking Cursors with Monitoring Agent version earlier than

If the agent authenticates as a user containing the clusterAdmin role, the agent might leak cursors if you enable profiling. A leaked cursor automatically times out on the server after 10 minutes.

Data Display

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

Time to Propagate Changes to the Automation

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

Rolling Restart of mongod Processes

Cloud 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.

Enable Profiling and the Collection of Profiling Data


Click Deployment, then the Processes tab, then the Topology view.


On the line listing the process, click Metrics.

Alternatively, you can click the process.


Click the Profiler tab above the charts.


Toggle the Profiling button to On.


Define slow operations.

By default, profiling collects data for operations that take longer than 100 milliseconds. The threshold for slow operations applies to all databases on the process. To change this threshhold, click the number of milliseconds and enter a new number.


Click Review & Deploy to review your changes.


Click Confirm & Deploy to deploy your changes.

Otherwise, click Cancel and you can make additional changes.

Enable Collection of Profiling Data

This procedure enables Cloud Manager to collect profiling data from a mongod instance. Separate from enabling Cloud Manager, you must enable each instance’s profiler, either upon deployment or through the setProfilingLevel command. If you are using Automation, set the profile option under Advanced Options to enable profiling upon deployment.

To enable collection of profiling data from an instance’s active profiler:


Click Deployment, then the Processes tab, then the Topology view.


Click the ellipses icon for the process and select Monitoring Settings.


Click the Profiling tab.


Turn on profiling.

Click the button to toggle between Off and On. When the button is On, Cloud Manager receives database profile statistics.