0


我的 mongodb 批量更新写入使用 mongo java 驱动程序很慢,然后我检查了 mongodb 日志文件,我观察到全局和集合级别锁定很高。
我修改了两个不同的索引,但仍然存在锁定问题。
如果您知道任何一个原因,请告诉我
MongoDB 日志:


2017-10-11T19:04:40.941+0530 我写 [conn1164] 更新 ghana.data_usage_summary 查询:{ MS:“6028150899”,MN:1,CD:2,CO:1,DI:1,MI:1706,ST : "14000Kbps", VT: "Science_Fiction", SI: 1, AD: 1, PI: 1, YM: 201710 } planSummary: IXSCAN { MS: 1.0, ST: 1.0, YM: -1.0 } update: { $inc: { DY.SU.10:1,DY.TO.10:0,DY.FL.10:0,HR.18.FL.10:0,WK.FL.1:0,MO.FL.0:0 , HR.18.SU.10: 1, HR.18.TO.10: 0, WK.SU.1: 1, WK.TO.1: 0, MO.SU.0: 1, MO.TO.0 : 0 } } keysExamined:1 docsExamined:1 nMatched:1 nModified:1 numYields:1 locks:{ Global: { acquireCount: { r: 20, w: 20 } }, Database: { acquireCount: { w: 20 } },收集:{acquireCount:{w:20}}}148ms
2017-10-11T19:04:41.035+0530 I COMMAND [conn1165] command ghana.$cmd command: update { update: "data_usage_summary",ordered: false, bypassDocumentValidation: true, updates: 1000 } numYields:0 reslen:59 locks :{全局:{acquireCount:{r:1021,w:1021}},数据库:{acquireCount:{w:1021}},集合:{acquireCount:{w:1021}}}协议:op_query 1046ms
2017-10- 11T19:04:41.663+0530 I COMMAND [conn1166] command ghana.$cmd command: update { update: "data_usage_summary", ordered: false, bypassDocumentValidation: true, updates: 1000 } numYields:0 reslen:59 locks:{ Global: { acquireCount: { r: 1032, w: 1032 } }, Database: { acquireCount: { w: 1032 } }, Collection: { acquireCount: { w: 1032 } } } protocol:op_query 1316ms


谢谢
Shankar

4

0 回答 0