1, Mongostat
To view statistics for a running MongoDB instance
2. MMS (MongoDB monitoring Service)
1) Installation
Rpm-u mongodb-mms-monitoring-agent-2.1.4.51-1.i386.rpm
2) configuration
- Visit https://mms.mongodb.com/settings
- Select the appropriate OS under the Monitoring agent and follow the instructions to configure
- When done, start Mms:service mongodb-mms-monitoring-agent start
- Then return to the page and go to setup and follow the instructions to configure
3. MongoDB Profile
Like slow queries in MySQL, MongoDB's slow query log feature
Common commands for viewing profiles:
Db.system.profile.find (). Sort ({$natural:-1})--View the latest profile
Db.system.profile.find ({millis:{$gt: +}). Sort ({$natural: -1}). Limit (5)--view execution times greater than 100ms and sort the first 5 rows in reverse order
Main indicators:
- ResponseLength: Length of query return
- Nscanned: How many objects were scanned while performing a query operation
- Nreturned: The result object returned from the query
Analysis:
- If the nscanned is larger, or nscanned is much larger than nreturned, it means that the database scans many objects to find the target object, so you need to index the query criteria.
- When the returned result set is large, i.e. the ResponseLength value is large, the performance is degraded, and a second query parameter is added to the Find query to get only the fields that need to be displayed.
4, explain
Execution plan
5, the maximum number of connections
- Db.serverstatus (). connections;
- Maximum number of connections to MongoDB = current value + Available value
- Start-up can add parameter--maxcounts=3000
See:
MongoDB Basic Management Command: http://blog.csdn.net/shirdrn/article/details/7105539
MongoDB Performance article: http://www.cnblogs.com/oubo/archive/2012/02/22/2394666.html
MongoDB Application article: http://www.cnblogs.com/oubo/archive/2012/02/22/2394665.html
MongoDB Foundation article: http://www.cnblogs.com/oubo/archive/2012/02/21/2394663.html