更新单个文档时mongodb 3.0全局锁定

时间:2016-03-17 12:01:21

标签: mongodb

查看不同的mongodb操作我发现mongodb 3.0,WT引擎正在生成许多不同的锁,有时甚至升级到全局锁,如下所示:

{
        "desc" : "conn4981286",
        "threadId" : "0x113f133400",
        "connectionId" : 4981286,
        "opid" : -371204669,
        "active" : true,
        "secs_running" : 0,
        "microsecs_running" : NumberLong(377),
        "op" : "update",
        "ns" : "xxx",
        "query" : {
            "_id" : ObjectId("56c82738ccb2d079eec4867c")
        },
        "client" : "xxx",
        "numYields" : 0,
        "locks" : {
            "Global" : "w",
            "local" : "w",
            "Database" : "w",
            "Collection" : "w"
        },
        "waitingForLock" : false,
        "lockStats" : {
            "Global" : {
                "acquireCount" : {
                    "r" : NumberLong(2),
                    "w" : NumberLong(2)
                }
            },
            "Database" : {
                "acquireCount" : {
                    "w" : NumberLong(2)
                }
            },
            "Collection" : {
                "acquireCount" : {
                    "w" : NumberLong(1)
                }
            },
            "oplog" : {
                "acquireCount" : {
                    "w" : NumberLong(1)
                }
            }
        }
    },

为什么更新会生成所有这些锁? 谢谢!

0 个答案:

没有答案