MongoDB – Profiling and performance

You can retrieve the status of your server by using:

See the list of running operations in current shell:


  • Exercise care killing operations on secondaries (replica set)
  • Exercise care killing compact operations
  • Don’t kill internal operations – data migration / sync


The mongostat utility provides a quick overview of the status of a currently running mongod or mongos instance.


Mongotop tracks the amount of time a MongoDB instance spends reading and writing data.



The database profiler collects fine grained data about MongoDB operations, cursors, and commands. Profiling can be enabled at database level or per MongoDB instance.

Levels of profiling :

  • 0 = off, no profiling
  • 2 = on
  • 1 = selective, show only slow operations ( > slowms)

A “new” collection will be visible. As a note, the system.profile collection is capped.

The output:

Retrieve the last profile info:

Additional links: