MongoDB Database Monitoring
MongoDB - An Overview
MongoDB is a NoSQL database designed for ease of development and scalability to support massive data processing and storage. With Applications Manager's MongoDB monitoring capability, we're letting users gain in-depth visibility into critical metrics to optimize their data infrastructures. Users can collect statistical data like Memory Utilizations statistics, open connections statistics, CPU usage, database operation performance and latency, transaction details, response time, lock current queue and journaling statistics. Applications Manager features graphs, custom dashboards and automated alerts to track performance and resource utilization of your database systems from a centralized console.
Creating a new MongoDB monitor
Supported Versions : From Applications Manager Version 16500, we support MongoDB v6.0 and below. Applications Manager versions till 16500, supports only MongoDB v5.x and below. Mongod and mongos services are also supported.
Prerequisites for monitoring MongoDB: Click here
Using the REST API to add a new MongoDB monitor: Click here
To create a Mongo database server monitor, follow the steps given below:
- Click on New Monitor link.
- Select Mongo.
- Specify the Display Name of the Mongo monitor.
- Enter the HostName or IP Address of the host where MongoDB/mongo process runs.
- Enter the Port where the server is running.By default, it will be 27017.
- To discover only this node and not all nodes in the ReplicaSet / Sharding disable the option Discover all nodes in the ReplicaSet / Sharding. By default, it is enabled.
- Check the Is Authentication Required field, to give the credentials to be used to connect to the MongoDB server. Now enter the UserName and Password of the credential.
- Check the Is SSL enabled field, so that SSL enabled MongoDB servers can be added as monitor.To add SSL certificate,refer here
- Specify the Polling Interval in minutes.
- If you are adding a new monitor from an Admin Server, select a Managed Server.
- Choose the Monitor Group with which you want to associate the MongoDB server to, from the combo box (optional). You can choose multiple groups to associate your monitor.
- Click Add Monitor(s). This discovers the MongoDB server from the network and starts monitoring it.
Note: Applications Manager by default connects to MongoDB 'Admin' database for monitoring.
Monitored Parameters
MongoDB is monitored based on the parameters or the attributes listed below. These attributes provide information about the functioning of the monitors of MongoDB. You can also configure thresholds to the numerical attributes monitored by the server based on these details.
Go to the Monitors Category View by clicking the Monitors tab. Click on MongoDB under the Database Table. Displayed is the Mongodb bulk configuration view distributed into three tabs:
- Availability tab, gives the Availability history for the past 24 hours or 30 days.
- Performance tab gives the Health Status and events for the past 24 hours or 30 days.
- List view enables you to perform bulk admin configurations.
Following are the list of tabs that are shown in MongoDB monitor:
Monitor Snapshot
The Monitor Snapshot tab displays the availability and performance history for the past 6 hours. The business view will help you have an integrated high-level view of the links between the different nodes in the replica set or sharding server. However, this view will not be available for single servers that are not part of any replica set or sharding server.
Server Stats
Parameters |
Description |
Performance Status |
Specifies the used and free memory of the server in percentage. |
Memory Utilization |
Specifies the used, free and total memory of the server in mega bytes. |
Current Connections |
Number of used and available connections in the database server. This will help to asses the current load and capacity requirements of the server. |
Network Traffic |
Specifies the amount of network traffic sent and received by the database, in bytes per second. This value will help you ensure that network traffic sent to and by the mongod process is consistent. |
Database Operations Counter |
The total number of various database operations (insert, get, query, update, command) per second since the mongod instance last started. This data helps to analyze and track the load on the database. |
Assert Errors |
The number of asserts (regular, warning, message, user, rollover) per second raised since the server process started. |
Lock Statistics |
The time, in seconds, since the database last started. |
Lock Current Queue Details |
Number of operations that are currently queued and waiting for the read-lock/ write-lock. |
Lock Active Client Details |
Number of active client connections to the database, performing read/ write operations. |
Background Flushes |
Number of times the database has flushed all writes to disk per second. |
Background Flushes Statistics |
Total number of seconds that the mongod processes have spent writing data to disk. |
Journaling Commits |
Number of transactions written to the journal during the last journal group commit interval. A Journal is a sequential, binary transaction used to bring the database into a consistent state in the event of a hard shutdown. MongoDB performs group commits when journaling, i.e., a series of operations are committed at once over many milliseconds. This is done to achieve high performance. |
Journaling Data |
Number of data in megabytes (MB) written to journal during the last journal group commit interval. |
Journaling Statistics |
Number of seconds spent for each phase of journaling in the last journal group commit interval. |
Note: All the metrics above in Server Stats will be displayed for a mongod device. Whereas for a mongos device, only the first six metrics will be displayed.
Following are the list of metrics that are monitored in this tab:
Cursors
Parameters |
Description |
Number of open cursors |
The maximum number of open cursors a session can have at once. You can use this parameter to prevent a session from opening an excessive number of cursors. |
Number of timed-out cursors |
The number of timed out cursors since the last server restart. |
Index Counters
Parameters |
Description |
Index Accessed |
The number of indexes accessed by a MongoDB statement. |
Index served from Memory |
Indexes that reside in memory and when queried, will be served from memory as long as the whole set fits in the memory. |
Index served from Disk |
Indexes that don't fit in the memory and must be served from disk. |
Miss Ratio |
The ratio of hits to misses. The misses is the total number of times that an operation tried to access an index that was not in memory per collection. The hits is the total number of times that indexes have been accessed and the mongod was able to return the index from memory per collection. |
Page Faults
Parameters |
Description |
Total Page Faults |
The total number of page faults that occured when MongoDB reads from or writes data to parts of its data files that are not currently located in physical memory or when physical memory is exhausted . |
Page Faults Counter |
MongoDB on Windows counts both hard and soft page faults. The MongoDB page fault counter may increase dramatically in moments of poor performance and may correlate with limited physical memory environments. |
Cursor Timeout
Parameters |
Description |
Cursor Timeout |
Timeout value set for the cursor (in ms). |
Memory Details
Parameters |
Description |
Memory Size |
Total memory size of the node (in bits). |
Resident Memory |
Amount of resident memory currently used by the database process (in MiB). |
Virtual Memory |
Amount of virtual memory currently used by the database process (in MiB). |
Mapped Memory |
Amount of mapped memory currently used by the database process (in MiB). |
Latency Details
Parameters |
Description |
Output Latency Read |
Latency statistics for read requests (in hrs). |
Output Latency Write |
Latency statistics for write requests (in hrs). |
Global Lock Details
Parameters |
Description |
Global Read Lock |
Number of read locks that are present globally. |
Global Write Lock |
Number of write locks that are present globally. |
Database Lock Details
Parameters |
Description |
Database Read Lock |
Number of read locks that are present for the database. |
Database Write Lock |
Number of write locks that are present for the database. |
Database Statistics
Parameters |
Description |
Database Name |
The name of the database whose statistics are being monitored. |
Collections |
The number of the Collections, i.e a group of MongoDB documents, in the database. |
Objects |
All the json data and performance objects in a collection. |
Avgerage Object Size |
The average size of all the KEY:VALUE objects contained within the shard. |
Data Size |
The size of data stored in a collection in MB. |
Indexes |
The total number of indexes in the database. |
Index Size |
The total size of all indexes on the database in KB. |
File Size |
The size of the files that hold the database contents in MB. |
Replica Stats
Parameters |
Description |
Replication Details |
Status information for MongoDB’s replica set configuration. Only when the current host has replication enabled these values will be displayed. |
Replication Operations Counter |
Total number of various database replication operations (insert, update, delete, getmore, command) per second since the mongod instance last started. These values will help to analyze the load on the replica. |
Sharding Operations Counter - Sharded/ NotSharded |
Total number of various database sharding and notsharding operations (insert, update, delete, getmore, command) per second since the mongos instance last started. |
Replication Buffer Count |
The current number of operations in the OpLog buffer. |
REPLICA AND SHARD |
Replica Count |
Number of replicas present in the database. |
Shard Count |
Number of shards present in the database. |
REPLICATION OPLOG DETAILS |
Configured oplog size |
Total OpLog size (in MB) configured by the customer or the default value configured which is 50 MB. |
Log length start to end |
The difference between the first and last operation in the OpLog (in seconds). |
OpLog first event time |
Timestamp of the first record present in OpLog. |
OpLog last event time |
Timestamp of the latest record present in OpLog. |
Note: The Replica Stats tab displays only replication details for a mongod device and sharding details for a mongos device.
Operation Details
Parameters |
Description |
OPERATION SCAN AND ORDER |
Operation Scan |
The total number of queries that return sorted numbers that cannot perform the sort operation using an index. |
Write Conflicts |
The total number of queries that encountered write conflicts. |
Cache Details
Parameters |
Description |
CACHE SIZE |
Cache Configured Size |
Maximum size configured for the cache (in GB). |
Cache Current Size |
Size of the data currently present in cache (in GB). |
DIRTY CACHE |
Dirty Cache Size |
Size of the dirty data in the cache (in GB). |
Dirty Cache Pages |
Number of dirty pages into the cache (in GB). |
CACHE PAGES DETAILS |
Cache Pages Read |
Number of pages read into the cache. |
Cache Pages Write |
Number of pages write into the cache. |
UnModified Evicted Pages |
Main statistics for page eviction. |
Threads Cache Pages |
A document that returns statistics on yields during page acquisitions. |
CACHE READ AND WRITE DETAILS |
Cache Read Size |
Amount of cache read (in GB). |
Cache Write Size |
Amount of cache write (in GB). |
Configuration
Parameters |
Description |
CONFIGURATION DETAILS |
HostName |
Host name on which the database is running. |
Version |
Version of the Mongodb database. |
Running Process |
Number of processes that are running. |
Process ID |
The process ID number. |