For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/public-cloud/databases/mongodb-monitoring-cluster.md.
  • English

MongoDB® - Monitoring a MongoDB cluster

View as Markdown

Learn about three best practice tips to use daily to keep your MongoDB® databases in top shape.

Warning

NOTE: The Discovery plan for MongoDB will be end-of-life on November 30, 2026.

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

 

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.

PaaS mongo - step 2

 

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.

>
db.serverStatus()
{
    host: 'replicaset-0',
    version: '7.0.12',
    process: 'mongod',
    pid: Long("565"),
    uptime: 4430,
        …
        "ok" : 1
    …
    opcounters: {
        insert: Long("5"),
        query: Long("2683"),
        update: Long("1150"),
        delete: Long("1324"),
        getmore: Long("3099"),
        command: Long("103420")
    },
    …
}

There are other commands you can use to return encrypted values, especially for a specific database: dbStats (db.stats())

>
db.stats()
{
     db: 'admin',
     collections: 3,
     views: 0,
     objects: 7,
     avgObjSize: 243,
     dataSize: 1701,
     storageSize: 94208,
     indexes: 4,
     indexSize: 131072,
     totalSize: 225280,
      scaleFactor: 1,
      fsUsedSize: 340033536,
      fsTotalSize: 1020702720,
      ok: 1,
      …
}

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.

Info

Before using the db.coll.stats command, you may need to create a collection using the 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 that you can access by clicking the more options ... button to the right of your connected service.

PaaS mongo - step 3

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

Browse all the Databases guides.

Browse the rest of the OVHcloud US documentation for guides on our other products and services.

Learn more about Managed Databases on the OVHcloud US website.

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.

OVHcloud Managed Databases and Analytics:

  • Grafana® is a registered trademark of Grafana Labs and is used with the permission of Grafana Labs. OVH SAS and its subsidiaries are not affiliated with or endorsed by Grafana Labs.
  • Kafka® is a registered trademark of The Apache Software Foundation and has been licensed for use by OVHcloud, who has no affiliation with and is not endorsed by The Apache Software Foundation.
  • MongoDB® is a registered trademark of MongoDB, Inc.
  • MySQL® is a registered trademark of Oracle and/or its affiliates.
  • PostgreSQL® is a registered trademark of the PostgreSQL Community Association of Canada.