Mongo Indexes Test

Indexes support the efficient execution of queries in MongoDB. If an appropriate index exists for a query, MongoDB can use the index to limit the number of documents it must inspect. Without indexes, MongoDB must perform a collection scan, i.e. scan every document in a collection, to select those documents that match the query statement. Collection scans are time-consuming, resource-intensive operations, which if not contained, can degrade performance of the database server and the dependent applications. To avoid these scans, each query to the Mongo server should be indexed. This is where the Mongo Indexes test helps.

This test monitors the queries to a target Mongo database server and reports the count and percentage of queries that are not serviced by indexes - i.e., the count and ratio of queries that are serviced by collection scans. This way, the test brings index-related inadequacies to the surface, and prompts administrators to improve query and over-all database performance by taking the necessary corrective action.

Note:

This test runs only on Mongo database servers below v3.0 only.

Target of the test : A MongoDB server

Agent deploying the test : An internal/remote agent

Outputs of the test : One set of results for the Mongo database server being monitored.

Configurable parameters for the test
Parameter Description

Test period

How often should the test be executed.

Host

The host for which the test is to be configured.

Port

The port number at which the specified host listens.

Database Name

The test connects to a specific Mongo database to run API commands and pull metrics of interest. Specify the name of this database here. The default value of this parameter is admin.

Username and Password

The eG agent has to be configured with the credentials of a user who has the required privileges to monitor the target MongoDB instance, if the MongoDB instance is access control enabled. To know how to create such a user, refer to How to monitor access control enabled MongoDB database?. If the target MongoDB instance is not access control enabled, then, specify none against the Username and Password parameters.

Confirm Password

Confirm the password by retyping it here.

Measurements made by the test
Measurement Description Measurement Unit Interpretation

Accesses

Indicates the rate at which queries/operations accessed the indexes.

Accesses/Sec

This is a good indicator of the workload of the database server.

Hits

Indicates the rate at which queries ran using indexes in memory.

Hits/Sec

A high value is desired for this measure.

Misses

Indicates the rate at which queries attempted to access an index that was not in memory.

Misses/Sec

A low value is desired for this measure.

Resets

Indicates the rate at which the index counter was reset.

Resets/Sec

Miss ratio

Indicates the percentage of time queries attempted to access indexes that are not in memory.

Percent

If the value of this measure is over 50%, then you need to look at your queries to see if they are making optimal use of the indexes you have created. You should consider adding new indexes and seeing if your queries run faster as a result.