0

非常抱歉,图片无法上传,只能文字描述了。

1.业务场景:每秒40个左右的mqtt消息写入mongodb,还有其他业务也在用这个数据库,他们的业务场景我不清楚。

2.环境描述:6台服务器,都是12GRAM,200G硬盘;分别部署了3个mongos,3个configServer,6个分片(每个分片是3个节点组成的复制集);

3.问题描述:

MongoDB Compass软件的Performance性能页面的SLOWEST OPERATIONS卡片中显示了很多Insert在4w秒左右。点开里面的详细信息:
WAIT LOCKfalse,为什么还不插入呢
自己查了百度和官网没有找到可以理解的答案,望大神解答,下面是里面的详细信息,官网查过这个信息是读取currentOp,但是还是不明白。

https://docs.mongodb.com/manual/reference/command/currentOp/#currentop-output-fields

{
“shard”: “shard3”,
“host”: “worker-149-1:23003”,
“desc”: “conn”,
“threadId”: “139714704754432”,
“connectionId”: 15,
“client_s”: “192.168.7.xxx:45150”,
“clientMetadata”: {
“driver”: {
“name”: “mongo-java-driver”,
“version”: “3.8.2”
},
“os”: {
“type”: “Linux”,
“name”: “Linux”,
“architecture”: “amd64”,
“version”: “5.4.6-1.el7.elrepo.x86_64”
},
“platform”: “Java/Oracle Corporation/1.8.0_111-8u111-b14-2~bpo8+1-b14”,
“mongos”: {
“host”: “master-140-1:22000”,
“client”: “192.168.7.xxx:51888”,
“version”: “3.6.3”
}
},
“active”: “true”,
“currentOpTime”: “2020-06-15T09:52:25.222+0800”,
“opid”: “shard3:274”,
“secs_running”: 4826,
“microsecs_running”: 4826198023,
“op”: “insert”,
“ns”: “das-handler.mqttMessage”,
“command”: {
“$truncated”: “…”
},
“numYields”: 0,
“locks”: {},
“waitingForLock”: “false”,
“lockStats”: {
“Global”: {
“acquireCount”: {
“r”: 4,
“w”: 2
}
},
“Database”: {
“acquireCount”: {
“r”: 1,
“w”: 2
}
},
“Collection”: {
“acquireCount”: {
“r”: 1,
“w”: 2
}
}
}
}

Answered question