We can inspect lock status using any of the following tools and commands:
-
db.serverStatus() through the locks document
-
db.currentOp() through the locks field
-
mongotop
-
mongostat
-
MongoDB Cloud Manager
-
MongoDB Ops Manager
Lock contention is a really important metric to keep track of, as it can bring our database to its knees if it grows out of control.
If we want to terminate an operation, we have to use the db.killOp() shell command.