Measures reported by MongoMemoryTest
MongoDB maps data files to memory for managing and interacting with all data. Memory mapping assigns files to a block of virtual memory with a direct byte-for-byte correlation. MongoDB memory maps data files to memory as it accesses documents. Unaccessed data is not mapped to memory. This provides MongoDB with an extremely fast and simple method for accessing and manipulating data.
This implies that if MongoDB is not sized with adequate virtual memory, then data accesses are bound to slow down, thus adversely impacting user experience with the server. To avoid this, administrators should periodically run the MongoMemoryTest test. This test monitors how the target MongoDB server utilizes the virtual memory, proactively detects potential memory contentions, and promptly alerts administrators to it, so that they can initiate measures to avert the contention and the consequent slow down.
Outputs of the test : One set of results for the target Mongo database server being monitored.
The measures made by this test are as follows:
| Measurement |
Description |
Measurement Unit |
Interpretation |
| Total_virtual_memory |
If the MMAPv1 storage engine is in use, then this indicates the amount of virtual memory mapped by the database. Because MongoDB uses memory-mapped files, this value is likely to be roughly equivalent to the total size of your database or databases. This value does not include memory allocated to journal.
If the WiredTiger storage engine is in use, then the value of this measure displays the quantity of virtual memory provided to the mongod process. This value includes memory allocated to the journal. |
GB |
|
| Mapped_memory |
Indicates the amount of memory unused. |
GB |
Note that this measure will be reported only if the target server uses the MMAPv1 storage engine.
The value of this measure is the difference between the value of the Total_virtual_memory and Resident_memory measures. |
| Resident_memory |
Indicates the amount of RAM currently used by the target server. |
GB |
During normal use, this value tends to grow. In dedicated database servers, this number tends to approach the total amount of system memory. |
| Memory_used |
Indicates the percentage of memory used. |
Percent |
This value is computed using the following formula:
(Used memory / Total memory) * 100
A value close to 100% indicates that almost all the memory is been utilized. No free memory or very little free memory will be available for database operations in this case, causing database performance to severely deteriorate. You may want to increase the memory allocation to the database instance to pre-empt this. |
| Mapped_mem_with_journal |
Indicates the amount of mapped memory, including the memory used for journaling. |
GB |
Note that this measure will be reported only if the target server uses the MMAPv1 storage engine and journaling is enabled.
The value of this measure will always be twice the value of the Total_virtual_memory measure. |
| Heap_memory_used |
Indicates the amount of Java heap memory used by the MongoDB server being monitored. |
GB |
A low value is desired for this measure. Note that this measure will be reported only if the target MongoDB server runs on Unix/Linux. |
|