- mongostat - shows incoming operation in real time.
- mongotop - to know which collection we're spending time reading from and writing to.
- mongoreplay - to monitor record and replay network traffic
- mongo
- profiler - logs queries
- compass
- mtools
Introducing Server Logs
Server Log Components
- ACCESS
- COMMAND
- CONTROL
- GEO
- INDEX
- NETWORK
- QUERY
- REPL
- SHARDING
- STORAGE
- JOURNAL
- WRITE
Level Description
F fatal
E error
W warning
I information, for Verbosity Levels of 0
D Debug, for All Verbosity Levels >
You can always run your system with maximum verbosity, if you wanted to capture more infomation.
currentOp and killOp
- currentOp - Shows what the server doing, the current operation
- killOp - To kill a operation
Introducing Server Status
db.serverStatus()
Although db.serverStatus() gives us a huge information, the output can be grouped into a few different sections.
List of Topics
- Instance Information
- Asserts
- Connections and Network
- Locking
- Operation stats
- Security
- Replication stats
- Storage Engine stats
- Metrics
We can do the projection of output like this
To check key of the command by js function
The output example of serverStatus
Introducing the Profiler
Turnning profiler on, every operation comming in will be stored in system.profile collection.
The collection size is 1 megabyte by default and is a capped collection.
It's better to turn off if there was no special needs.
level:
0: not capture any query
1: capture queries that take longer than 100ms
2: capture all queries
- bsondump
- mongo
- mongod
- mongodecrypt
- mongodump
- mongoexport
- mongofiles
- mongoimport
- mongoldap
- mongooplog
- mongoperf
- mongoreplay
- mongorestore
- mongos
- mongostat
- mongotop
$indexStats
We can get the usage frequency by using the aggreation.
DOC