MongoDB monitoring four Dbstats and Collstats and Replsetgetstatus

Source: Internet
Author: User
Tags mongodb monitoring

    1. Dbstats command

      The Dbstats command can return storage information for a specified database, by default displaying storage information in bytes, and you can add a scale parameter, such as scale:1024 for kilobytes display. The time to return information is determined by the size of the specified database.

> Db.runcommand ({dbstats:1,scale:1}) {"DB": "Test", "collections":, "Objects": 161, "avgobjsize": 61.39130434782 6086, "datasize": 9884, "storagesize": 245760, "numextents": "Indexes": "Indexsize": 547792, "fileSize": 201326592 , "NSSIZEMB": +, "datafileversion": {"Major": 4, "minor": 5}, "OK": 1}
> Db.runcommand ({dbstats:1,scale:1024}) {"DB": "Test", "collections":, "Objects": 161, "avgobjsize": 61.39130434 7826086, "DataSize": 9, "storagesize": +, "numextents": "Indexes": "Indexsize": 534, "fileSize": 196608, "Nssizem" B ": +," datafileversion ": {" Major ": 4," minor ": 5}," OK ": 1}

You can also use Db.stats () or db.stats (1024)

> Db.stats (1024x768) {"DB": "Test", "Collections": "Objects": 161, "avgobjsize": 61.391304347826086, "datasize": 9, "St Oragesize ":" numextents ":" Indexes ":" Indexsize ": 534," fileSize ": 196608," nssizemb ": +," datafileversion " : {"Major": 4, "minor": 5}, "OK": 1}

DB name of the current database, if you want to view the storage information for the specified database, you can use the Using test

Collections the number of collections contained in the current database

Objects the number of objects (such as documents) contained in all collections in the database

Avgobjsize the average size of each document, expressed in bytes, which equals datasize divided by objects

Dataszie the size of the data held by the current database, including the padding factor, the scale affects this value, and when the size of the document shrinks, the Dataszie does not decrease, but if you delete the document, the DataSize value decreases

Storagesize The amount of storage allocated to the database used to store all the collections in the bytes calculation, the scale affects this value, and the value of storagesize does not decrease when the document is deleted or shrunk

numextents The number of extent contained in all collections in the database

Indexes the number of indexes contained in all collections in the database

Indexsize the size of all indexes created on this database, expressed as bytes, scale affects this value

The size of the data file for the FileSize database, in bytes, which includes pre-allocated space and padding factor, which only reflects the size of the data file and does not reflect the size of the domain name space

This article is from the Linux SA John blog, so be sure to keep this source http://john88wang.blog.51cto.com/2165294/1564602

MongoDB monitoring four Dbstats and Collstats and Replsetgetstatus

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.