1

Why would an insert into a MongoDB 3.4 collection require global write locks? I'm creating a copy of a large collection in a new replica set (via mongodump/restore) and I'm finding that some inserts are taking > 100 seconds to run, however if I run an insert from the shell, it takes only a second or two. An example of an insert is below

 {
        "desc" : "conn433",
        "threadId" : "140528463828736",
        "connectionId" : 433,
        "client" : "127.0.0.1:39208",
        "active" : true,
        "opid" : 2609838,
        "secs_running" : 114,
        "microsecs_running" : NumberLong(114553087),
        "op" : "insert",
        "ns" : "dbName.collectionName",
        "query" : "{ insert: \"collectionName\", documents: [ ...",
        "numYields" : 0,
        "locks" : {
            "Global" : "w",
            "Database" : "w",
            "Collection" : "w"
        },
        "waitingForLock" : false,
        "lockStats" : {
            "Global" : {
                "acquireCount" : {
                    "r" : NumberLong(23),
                    "w" : NumberLong(23)
                }
            },
            "Database" : {
                "acquireCount" : {
                    "w" : NumberLong(23)
                }
            },
            "Collection" : {
                "acquireCount" : {
                    "w" : NumberLong(12)
                }
            },
            "Metadata" : {
                "acquireCount" : {
                    "w" : NumberLong(11)
                }
            },
            "oplog" : {
                "acquireCount" : {
                    "w" : NumberLong(11)
                }
            }
        }
      }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.