I have a single MongoDB instance is performing quite badly. I noticed that db.currentOP().inprog.length quite often becomes quite big, sometimes even goes up to 100. When I drill down to the actual ops, I find op entry like below.

        "opid" : 2.91967e+007,
        "active" : true,
        "secs_running" : 0,
        "microsecs_running" : NumberLong(940789),
        "op" : "update",
        "ns" : "DB1.Collection1",
        "query" : {
            "_id" : "ID1"
        "client" : "192.168.X.X1:PORT1",
        "desc" : "conn1068760",
        "connectionId" : 1.06876e+006,
        "locks" : {
            "^DB1" : "W"
        "waitingForLock" : true,
        "numYields" : 0,
        "lockStats" : {
            "timeLockedMicros" : {},
            "timeAcquiringMicros" : {}

Notice that its waitingForLock property is set to true. How do I know which process is locking the collection and preventing the query from execution?

I'm not sure if MongoDB has deadlock situation or not, but from administration perspective, it's always good to identify the blocking process and diagnose what's causing the issue.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.