Learn about three ways to get best practice tips to use daily to keep your MongoDB databases in top shape.
Monitoring MongoDB databases is crucial for detecting glitches and slowdowns, which in turn allows you to make sure a system is working properly, particularly in terms of availability, reliability, and scalability.
You can monitor your databases via the OVHcloud Control Panel (and also view summary and history), using a command line interface (CLI), or a graphical user interface (GUI).
Requirements
- a Public Cloud project in your OVHcloud account
- access to the OVHcloud Control Panel
- a MongoDB database running on your OVHcloud Managed - also called Cloud - Databases (this guide can help you to meet this requirement)
- an account you can use to log in to MongoDB (this guide can help you meet this requirement)
Instructions
Using the metrics provided by OVHcloud
You can use the main metrics and statistics in the OVHcloud Control Panel to track and manage your database instance.
For each Public Cloud Database service, in the Metrics
tab, you can find the following charts:
- CPU used (%)
- Disk space used
- Number of read IOPS
- Number of write IOPS
- Memory used (only available for Production service plans)
- Network reception (Mbps)
- Network transmission (Mbps)
These metrics are available for a set amount of time — 1 hour, 1 day, 1 week, 1 month, and 1 year. You can also enable automatic refresh if you want to leave this tab open.
Using the CLI (Command Line Interface) to retrieve information
Depending on the solution you’ve signed up for (Discovery or Production), you can use Mongo Shell.
Please note that to access this data, you need MongoDB elevated privileges, including the "clusterMonitor" role for retrieving server statistics.
Three commands can be used to obtain real-time information:
You can find out how the server works via the general serverStatus()
command. You can also use it to gather data about the different types of queries you perform.
There are other commands you can use to return encrypted values, especially for a specific database: dbStats (db.stats()
)
Just as dbStats returns information on a specific database, you can also use the collStats command db.coll.stats()
to access information about a specific data collection.
db.coll.insertOne({ exampleField: "exampleValue" })
command.
Using a GUI (Graphical User Interface) to monitor the status of MongoDB instances
Depending on the solution you’ve signed up for (Discovery or Production), you can use the same "MongoDB Compass" tool. This is a cross-platform tool — designed to run on any device: Mac, Windows, and Linux. It is available on the official MongoDB website.
MongoDB Compass has a Performance tab you can access by clicking the more options ...
button to the right of your connected service.
This tab displays the following information in real time, particularly for troubleshooting or fine-tuning:
- Operations: number of operations carried out (i.e., INSERT, COMMAND, UPDATE, etc.)
- Read & write: the number of reads/writes performed
- Network: the number of current server connections
- Memory: server’s RAM usage
- Hottest Collections: means the most frequently used collections at the time they are collected
- Slowest Operations: the slowest operations at the time of reading
You can also stop an operation listed under "Slowest Operations" if it takes too long. Clicking on the targeted operation will open the "Operation Details" panel on the right. Clicking on the KILL OP
button will terminate this request.
Go further
For more information and tutorials, please see our other MongoDB and Cloud Databases support guides or explore the guides for other OVHcloud products and services.
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.