使用mongodb,我知道我可以使用命令
db.serverStatus()
这将返回有关当前mongo实例的大量信息,包括内存信息:
"mem" : {
"bits" : 64,
"resident" : 4303,
"virtual" : 7390,
...
}
此输出中是否有类似内容或可能缺少的内容,还会报告 CPU 使用详情?
即
"cpu" : {
"usr" : 32,
"wa" : 16,
"id" : 52
}
答案 0 :(得分:0)
您可以尝试top
命令并检查输出是否为您提供了必要的信息。切换到管理数据库并发出:
db.runCommand( { top: 1 } )
{
"totals" : {
"note" : "all times in microseconds",
"Orders.orders" : {
"total" : {
"time" : 107211,
"count" : 56406
},
"readLock" : {
"time" : 107205,
"count" : 56405
},
"writeLock" : {
"time" : 6,
"count" : 1
},
"queries" : {
"time" : 105,
"count" : 1
},
"getmore" : {
"time" : 0,
"count" : 0
},
"insert" : {
"time" : 0,
"count" : 0
},
"update" : {
"time" : 0,
"count" : 0
},
"remove" : {
"time" : 0,
"count" : 0
},
"commands" : {
"time" : 0,
"count" : 0
}
},.... rest clipped as it gives per db stats