- Alerts and Monitoring >
- Profile Databases
Profile Databases¶
On this page
Overview¶
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 that have profiling enabled. Ops Manager displays this data in the Profiler section of an instance’s Metrics page.
- To enable a given mongod’s profiler and have Ops Manager collect its profiling data, see the Enable Profiling and the Collection of Profiling Data procedure.
- To allow Ops Manager to collect profiling data from a mongod instance that has profiling enabled, see the Enable Collection of Profiling Data procedure.
- To enable or disable Ops Manager profiling data collection for all instances in the project, see Project Settings.
Considerations¶
Important
Please read the following considerations before enabling profiling.
Security¶
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.
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, Ops Manager ignores data about operations on
the system.profile
collection, such as
Monitoring Agent 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 Ops Manager.
See also
Database Profiler in the MongoDB Manual.
Ops 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 Agent tries to minimize its effect on the monitored systems. If polling profile data slows database performance, Ops Manager throttles how often it collects data.
Leaking Cursors with Monitoring Agent version earlier than 3.8.0.230
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¶
Ops Manager displays no more than 10,000 data points in the Profiler charts.
Time to Propagate Changes to the Automation Agent¶
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.
Rolling Restart of mongod
Processes¶
Ops Manager performs a rolling restart of the mongod
processes in
your cluster when you enable 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 Agent.
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 Ops Manager to collect profiling data from a
mongod instance. Separate from enabling Ops 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, Ops Manager receives database profile statistics.