Differences between revisions 1 and 2
Revision 1 as of 2020-04-12 07:04:08
Size: 741
Editor: PieterSmit
Comment:
Revision 2 as of 2020-04-12 07:05:26
Size: 874
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
 * [[attachment:MongoDB-Performance-Best-Practices.pdf]] https://neotan.github.io/images/media/MongoDB-Performance-Best-Practices.pdf

MongoDb/Performance

Slow / Long running queries

  • * $ mongo 10.32.2.4 --authenticationDatabase admin --username test --password mypass
  • > db.currentOp()

  • > db.currentOp({"secs_running": {$gte: 3}})

  • Count documents in <db> <collection>

    • use <db>;

    • db.<collection>.count()

  • DB locks
    • > db.serverStatus().globalLock

    • > db.serverStatus().locks

  • DB version , want > 3.2 wiretiger document level locking

    • > db.version()

  • DB memory usage should be less than ram
    • > db.serverStatus().mem

    • > db.serverStatus().wiredTiger.cache

  • Check number of connections
    • db.serverStatus().connections
  • Check indexs on a collection
    • db.<collection>.getIndexes()

MongoDb/Performance (last edited 2020-05-14 18:10:41 by PieterSmit)