Mongo Databases Test

Storage space contentions on a database can result in the loss of critical data. To avoid this, administrators should keep a close watch on the space usage of each database, proactively detect a space crunch, and promptly resolve it. This is where the Mongo Databases test helps. This test auto-discovers all the databases on the MongoDB server and monitors the availability and space usage of each database. Alerts are promptly sent out if any database is found to be unavailable or is running out of space. In the event of a space crunch in a database, you can also use this test to figure out what is causing the space drain - documents? index files? or namespace files?

Target of the test : A MongoDB server

Agent deploying the test : An internal/remote agent

Outputs of the test : One set of results for each database on the 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. By default, this is 27107.

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.

Authentication Mechanism

Typically, the MongoDB supports multiple authentication mechanisms that users can use to verify their identity. In environments where multiple authentication mechanisms are used, this test enables the users to select the authentication mechanism of their interest using this list box. By default, this is set to None. However, you can modify this settings as per the requirement.

SSL

By default, the SSL flag is set to No, indicating that the target MongoDB server is not SSL-enabled by default. To enable the test to connect to an SSL-enabled MongoDB server, set the SSL flag to Yes.

CA File

A certificate authority (CA) file contains root and intermediate certificates that are electronically signed to affirm that a public key belongs to the owner named in the certificate. If you are looking to monitor the certificates contained within a CA file, then provide the full path to this file in the CA File text box. For example, the location of this file may be: C:\cert\rootCA.pem. If you do not want to monitor the certificates in a CA file, set this parameter to none.

Certificate Key File

A Certificate Key File specifies the path on the server where your private key is stored. If you are looking to monitor the Certificate Key File, then provide the full path to this file in the Certificate Key File text box. For example, the location of this file may be: C:\cert\mongodb.pem. If you do not want to monitor the certificates in a CA file, set this parameter to none.

Measurements made by the test
Measurement Description Measurement Unit Interpretation

Is database available?

Indicates whether/not this database is available.

Boolean

This measure reports the value Yes if the database is available and the value No if it is not.

The numeric values that correspond to the aforesaid measure values are as follows:

Measure Value Numeric Value
Yes 1
No 0

Note:

Typically, this measure reports the Measure Values listed above to indicate database availability. However, in the graph of this measure, the same is indicated using the numeric equivalents only.

Total database size

Indicates the total size of this database.

Note:

This measure is applicable only if the monitored MongoDB server uses the MMAPv1 storage engine.

GB

Storage size

Indicates the total amount of space allocated to collections in this database for document storage.

GB

Every MongoDB database instance consists of a namespace file, journal files and data files. Data files store BSON documents, indexes, and MongoDB-generated metadata in structures called extents. Each data file is made up of multiple extents. Extents are logical containers within data files used to store documents and indexes. Data and indexes are each contained in their own sets of extents. The value of this measure is equal to the size of all the data extents in a database.

Storage size does not decrease as you remove or shrink documents. This value may be smaller than the value of the Total Data size measure for a database that is using the WiredTiger storage engine with compression enabled. For a database that is using the MMAPv1 storage engine on the other hand, this value may be larger than the value of the Total Data size measure because it includes yet-unused space (in data extents) and space vacated by deleted or moved documents within extents.

Index size

Indicates the total size of all indexes created on this database.

GB

If the Space utilization measure reports a value close to 100%, you may want to compare the Storage size, Index size, Namespace file size, or Data size measures, to know where space is consumed the maximum.

Used space

Indicates how much space allocated to this database is currently in use.

Note:

This measure is applicable only if the monitored MongoDB server uses the MMAPv1 storage engine.

GB

Free space

Indicates how much space allocated to this database is still available for use.

Note:

This measure is applicable only if the monitored MongoDB server uses the MMAPv1 storage engine.

GB

Space utilization

Indicates the percentage of allocated space that is used by this database.

Note:

This measure is applicable only if the monitored MongoDB server uses the MMAPv1 storage engine.

Percent

If the Space utilization measure reports a value close to 100%, its a cause for concern, as it implies that your database is rapidly running out of space. Under such circumstances, you may want to consider allocating more space to this database.

Average object size

Indicates the average size of each document in this database.

GB

If the Space utilization of a database is increasing consistently along with the value of the Data size measure, then, you may want to check the value of this measure. If the value of this measure is also very high, then you can conclude that the space usage is owing to the large size of documents in the database.

Namespace file size

Indicates the total size of all namespace files in this database.

Note:

This measure is applicable only if the monitored MongoDB server uses the MMAPv1 storage engine.

GB

If the Space utilization measure reports a value close to 100%, you may want to compare the Storage size, Index size, Namespace file size, or Data size measures, to know where space is consumed the maximum.

Total extents

Indicates the total number of extents across all collections in this database.

Number

Extents are logical containers within data files used to store documents and indexes. Data and indexes are each contained in their own sets of extents.

Total indexes

Indicates the total number of indexes across all collections in this database.

Number

Data size

Indicates the total size of all the documents and padding stored in the database.

GB

The value of this measure will decrease when you delete documents, but will not decrease when documents shrink because the space used by the original document has already been allocated (to that particular document) and cannot be used by other documents. Alternatively if a user updates a document with more data, the value of this measure will remain the same as long as the new document fits within its originally padded pre-allocated space.

Growth rate

Indicates the percentage growth in the size of this database.

Percent

The value of this measure is calculated using the following formula:

(Data size + Index size) of the current measurement period (-) (Data size + Index size) of the previous measurement period * 100

A consistent increase in the value of this measure is a cause for concern, as it indicates a steady growth in database size.

Compression ratio

Indicates the rate at which data in storage is compressed.

Percent

If the Growth rate is very high and the Compression ratio is very low, you may want to consider increasing the compression ratio to conserve storage space and optimize growth rate.

Used space on disk

Indicates the spaced used by this database on disk.

GB

 

Total space on disk

Indicates the total capacity of this database.

GB

 

Free percentage on disk

Indicates the percentage of space on disk that is unused by this database.

Percent

A value close to 100% indicates that the database is about to run out of free space on disk. Without enough space, the database will not be able to hold new records. To avoid this, its best that you remove stale data from the database, thus making room for new data.