MongoDb锁定超过100%是否正常?

时间:2014-01-17 17:10:45

标签: java performance mongodb mongo-java

您好我正试图在一个约700万份文档的集合上插入文档。这是我个人资料中的记录

{
    "op" : "update",
    "ns" : "productService.products20140117",
    "query" : {
        "_id" : "77004704"
    },
    "updateobj" : {
        "$set" : {
            "some long document"
        }
    },
    "nscanned" : 0,
    "idhack" : true,
    "nupdated" : 1,
    "fastmodinsert" : true,
    "keyUpdates" : 0,
    "numYield" : 0,
    "lockStats" : {
        "timeLockedMicros" : {
            "r" : NumberLong(0),
            "w" : NumberLong(203)
        },
        "timeAcquiringMicros" : {
            "r" : NumberLong(0),
            "w" : NumberLong(3)
        }
    },
    "millis" : 0,
    "ts" : ISODate("2014-01-17T10:44:26.868Z"),
    "client" : "127.0.0.1",
    "allUsers" : [ ],
    "user" : ""
}

这是我从mongostat

获得的
insert  query update delete getmore command flushes mapped  vsize    res faults                locked db idx miss %     qr|qw   ar|aw  netIn netOut  conn       time 
    *0     *0     *0     *0       0     1|0       0  11.4g  13.8g  2.02g      1    productService:200.2%          0       0|0     0|1    62b     3k     3   17:07:44 
    *0     *0     *0     *0       0     1|0       0  11.4g  13.8g  2.02g      0    productService:199.8%          0       0|0     0|1    62b     3k     3   17:07:45 
    *0     *0      1     *0       0     2|0       0  11.4g  13.8g  2.02g      0    productService:294.0%          0       0|0     0|1   335b     3k     3   17:07:46 
    *0     *0     *0     *0       0     1|0       0  11.4g  13.8g  2.02g      0     productService:11.9%          0       0|0     0|1    62b

这是正常的,我认为不是。但是如何降低锁定%。或者我的收藏太大了?我在我的Macbook Air上做这个,8GB。如果这可能是一个问题,我如何修复高百分比的锁定?

我正在使用Java Driver 2.1.11和MongoDb 2.4

0 个答案:

没有答案