Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Tool to collect block cache statistics for a MongoDB instance based on $showDiskLoc and mincore(2)
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.travis.yml
Makefile
README.md
mongo_astyle
mongocachestat.cpp

README.md

mongocachestat

Build Status

Tool to collect block cache statistics for a MongoDB instance based on $showDiskLoc and mincore(2).

Prerequisites

  • MongoDB 2.6 or newer because of SERVER-5372
  • MongoDB client library and headers installed

Building

# apt-get install mongodb-dev libmongo-client-dev libboost-system-dev libboost-regex-dev libboost-thread-dev libboost-filesystem-dev
# make

Usage

MongoDB needs to be up and running.

# ./mongocachestat [--directoryPerDb] <dbpath> [<host:port>]

Example:

# ./mongocachestat /data/mongodb localhost:27017

Implementation detail

Potential "Heisenberg effects" (i.e. changing the cache state by measuring with this tool) are tried to be minimized by using madvise(…, …, MADV_RANDOM). It turns off Linux kernel read-ahead and read-behind. We call it Heisenberg compensator in analogy to a famous science fiction series.

Something went wrong with that request. Please try again.