Pricing Login
Pricing
Support
Demo
Interactive demos

Click through interactive platform demos now.

Live demo, real expert

Schedule a platform demo with a Sumo Logic expert.

Start free trial
Back to blog results

January 19, 2017 By Vince Power

Overview of MongoDB Performance Monitoring

Monitoring components of a system, especially for performance, is the best (and really the only) way to ensure a consistent user experience and that all service levels are being achieved. System monitoring is often left to operations to figure out after the system is built and “production ready.” This article will highlight the main areas to ensure they are monitored in MongoDB.

What Is Performance Monitoring?

Performance monitoring is combining all the various other types of monitoring of an application, or component, to have an overall view of system performance. Good performance monitoring also provides the ability to compare current performance levels to what has been set in service level agreements and trends.

The utopia of performance monitoring is to be predictive and proactive. Find changes in performance, tell the appropriate group about it, and resolve it before it ever impacts a client.

Critical Metrics to Monitor in MongoDB

If this was a web or mobile application, then you’d probably be thinking response time, and you would be correct. Except in MongoDB, the only response it tracks easily is how long it is taking to write out to its peers in its replication agreements. This is a valid metric since every user transaction gets written to at least one peer. Read times aren’t tracked as their own metric inside the platform.

The other critical data point to monitor for performance is disk I/O. MongoDB, like any database platform, relies heavily on the speed it can read and write to the disk. If the disk I/O gets to 100% that means everything is now waiting on disk access and the entire system will slow to a crawl.

Extremely Useful MongoDB Metrics

Knowing the usage pattern in your database is critical to trending performance. So tracking how many reads (selects) and writes (insert, update, delete) are being performed at a regular interval will definitely help so you can tune (and size) the system accordingly.

In conjunction with tracking the actual reads and writes, MongoDB also exposes the number of clients actively doing reads and the number doing writes. Combining these two metrics will allow better cache tuning and can even decide when adding more replicas would make sense.

The last extremely useful metric for performance monitoring in MongoDB, in my opinion, is capturing slow queries. This is very useful for developers to find missing indexes, and tracking the number will find ways that clients are using the system that weren’t originally envisioned.

I’ve seen unexpected client behavior in the past. For instance, once a user base figured out they could do wildcard searches, they stopped typing an exact 12-digit number and just searched on the first digit followed by a %. An index brought performance back in line, but it was not expected. (Remember that people are like water. They will find the fastest way to do things and follow that route for good or bad.)

Additional MongoDB Metrics to Monitor

Most of the metrics in this section are solid and valuable, but are too coarse-grained to be of the same value as the metrics in the above sections. The following are good overall metrics of system health, and will definitely help in scaling the database system up and down to meet the needs of your applications.

MongoDB has internal read and write queues that can be watched, and will only really be used when MongoDB can’t keep up with the number of requests that are incoming. If these are used often, then you will probably need to look into adding capacity to your MongoDB deployment.

Another great metric to trend is the number of client connections, and available connections. Then, of course, there are always metrics at the machine level that are important to watch on all of your nodes. These include memory, CPU, and network performance.

Monitoring Tools to Use

More information on the tools that ship with MongoDB for monitoring are available at mongoDB. And there are operational support platforms, like Sumo Logic, which provide a much more visual and user-friendly way to review these metrics. Sumo Logic also has the Sumo Logic App for MongoDB that includes pre-built queries and dashboards allowing you to track overall system health, queries, logins and connections, errors and warnings, replication, and sharding. You can learn more about the app from the MongoDB documentation. If you don’t already have a Sumo Logic account, sign up for the Free Trial and take the app for a spin.

About the Author

Vince Power is a Solution Architect who has a focus on cloud adoption and technology implementations using open source-based technologies. He has extensive experience with core computing and networking (IaaS), identity and access management (IAM), application platforms (PaaS), and continuous delivery.

Overview of MongoDB Performance Monitoring is published by the Sumo Logic DevOps Community. If you’d like to learn more or contribute, visit devops.sumologic.com. Also, be sure to check out Sumo Logic Developers for free tools and code that will enable you to monitor and troubleshoot applications from code to production.

Complete visibility for DevSecOps

Reduce downtime and move from reactive to proactive monitoring.

Sumo Logic cloud-native SaaS analytics

Build, run, and secure modern applications and cloud infrastructures.

Start free trial
Vince Power

Vince Power

Vince Power is a Solution Architect who has a focus on cloud adoption and technology implementations using open source-based technologies. He has extensive experience with core computing and networking (IaaS), identity and access management (IAM), application platforms (PaaS), and continuous delivery.

More posts by Vince Power.

People who read this also enjoyed