Lesson 2: More Metrics / Learn

Video Transcript (English)

Imagine you receive reports that there’s an issue with your application’s database query performance. You review the core metrics covered in the previous lesson but there aren’t any observable issues.

As a next step, you can review some additional metrics to assist with your investigation into the database query performance issue, including: Opcounters, Network traffic, Connections, Tickets available.

Let's discuss each one. 

Opcounters represent the number of operations per second run on a MongoDB deployment since the last restart. MongoDB tracks the following operations: command, query, insert, delete, update, getMore.

Opcounters help correlate changes in operations with a deployment’s performance. For example: An unexpected change in the number of read operations leads to a sudden drop in performance.

Here’s an example of what you might see for Opcounters on our Atlas Metric Dashboard.

The y-axis represents the average number of operations per second and the x-axis shows this value over time. The different lines on this graph represent different operations. For example, the blue line represents the number of commands run.

Network traffic metrics provide information about your network performance and include bytesIn, bytesOut, and NumRequests.

These metrics indicate the average rate of physical bytes sent to and from the database server per second over the selected time range.

Excessive Network traffic can affect performance

Here’s an example of what you might see for network traffic on our Atlas Metric Dashboard.

The blue line represents bytesIn, or the average rate of physical bytes sent to the database. The green line represents bytesOut, or the average rate of physical bytes sent from the database.

Finally, the light green line at the top represents numRequests, or the average number of requests sent to the database.

Connections represent the total number of open network connections to the database by application, shell clients, as well as internal MongoDB connections.

Connections consume system resources and an excessive number of connections can affect the system performance.

Moreover, a large number of connections may indicate a suboptimal client connection strategy which can degrade application performance.

Here’s an example of what you might see for connections on our Atlas Metric Dashboard.

The Y-axis represents the number of connections to the database while the X-axis represents the time. The blue line shows that the number of connections is hovering around 50, well under the limit of 1500 for an M10 cluster.

Tickets Available indicates the number of concurrent read and write operations available to the MongoDB storage engine.

When available tickets drop to zero, other operations must wait until one of the running operations completes and frees up a ticket.

This slowdown of operations will impact application performance and is indicative of an undersized cluster or poorly performing queries.

Here’s an example of what you might see for Tickets available on our Atlas Metric Dashboard.

It looks like we have over 100 read and write tickets available in this example.

The default limit for read and write tickets is 128 so we are doing great!

After having reviewed these additional metrics, you'll likely notice a correlation between a change in a metric and your application's database query performance. In fact, in most cases, multiple metrics will change, providing valuable insights for your investigation.

Great work! In this video, we covered some additional metrics including: Opcounters which represent the number of operations run per second on a MongoDB deployment. Network traffic metrics which provide information about your network performance. Connections metrics which represent the total number of open network connections to the database deployment. And Tickets Available which indicates the number of concurrent read and write operations available to the MongoDB storage engine.