Giter VIP home page Giter VIP logo

mongovis's Introduction

THIS IS A WORKING COPY

Storage-viz, visualize Mongo's storage and indexes

© 2012 10gen, the MongoDB Company

Authors: Andrea Lattuada

The commands used by this tool are currently EXPERIMENTAL and UNSUPPORTED.

Storage-viz is a suite of web-based visualizers that leverage new database commands: they make it easier to understand and analyze MongoDB storage and btree layout.

OVERVIEW

The storageDetails command will aggregate statistics related to the storage layout (when invoked with analyze: "diskStorage") or the percentage of pages currently in RAM (when invoked with analyze: "pagesInRAM") for the specified collection, extent or part of extent.

The indexStats command provides detailed and aggregate information and statistics for the underlying btree of a particular index. Stats are aggregated for the entire tree, per-depth and, if requested through the expandNodes option, per-subtree.

Both commands take a global READ_LOCK and will page in all the extents or btree buckets encountered: this will have adverse effects on server performance. The commands should never be run on a primary and will cause a secondary to fall behind on replication. diskStorage when run with analyze: "pagesInRAM" is the exception as it typically returns rapidly and may only page in extent headers.

USAGE

To use the commands and visualizers you need a recent MongoDB Nightly build.

You can enable the experimental commands with

    --enableExperimentalStorageDetailsCmd

or

    --enableExperimentalIndexStatsCmd

NOTE: running mongod with these options is unsafe and not advisable for production servers.

If you'd like to run the commands directly within the shell, helpers are available.

Json output:

db.collection.diskStorageStats({...})
db.collection.pagesInRAM({...})
db.collection.indexStats({index: "index name", ...})

Their counterparts providing human-readable output follow.

db.collection.getDiskStorageStats({...})
db.collection.getPagesInRAM({...})
db.collection.getIndexStats({...})

VISUALIZERS

To use the visualizers the server needs to be started with the --rest --jsonp command line flags.

NOTE: running mongod with these options is unsafe and not advisable for production servers. Moreover, --rest --jsonp allows anyone on the same network as the server to invoke commands and query or modify data.

The visualizers provide a nicer graphical representation but are very early stage and have only been tested in Chrome. The source code for them is available in this repository.

https://utaal.github.com/mongovis/diskStorageStats.html displays storage layout and usage.

https://utaal.github.com/mongovis/indexStats.html shows statistics related to the indexing btrees.

https://utaal.github.com/mongovis/pagesInRAM.html reports which parts of a collection is currently in ram.

ADDITIONAL

If you'd like to report a bug or request a new feature, please file an issue on our github repository (you must be logged into github to do this):

https://github.com/10gen-labs/storage-viz/issues/new

mongovis's People

Contributors

utaal avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.