【发布时间】:2014-09-17 20:06:59
【问题描述】:
-
据我了解,
maxTimeMS应该在查询超过分配的时间后立即终止查询(+- 2,3 秒)。但是 mongo 并没有立即终止查询并花费太多时间。 -
下面
currentOp()的输出可以看到观察到这个
{
"inprog" : [
{
"opid" : 176078308,
"active" : true,
"secs_running" : 105,
"op" : "query",
"ns" : "xxx",
"query" : {
"aggregate" : "tweets",
"pipeline" : [
{
"$match" : {
"gTs" : {
"$lte" : ISODate("2014-07-25T22:00:00Z"),
"$gte" : ISODate("2014-07-20T21:00:00Z")
},
"RE_H" : {
"$in" : [
NumberLong("884327843395156951")
]
}
}
},
{
"$match" : {
"$and" : [
{
"l" : {
"$in" : [
"bandra",
"mumbai",
"thane",
"bombay",
"mahim"
]
}
},
{
"ts" : {
"$lte" : ISODate("2014-07-25T21:16:00Z"),
"$gte" : ISODate("2014-07-20T21:16:00Z")
}
}
]
}
},
{
"$project" : {
"!" : 1,
"s" : 1,
"nR" : 1,
"ts" : 1
}
}
],
"cursor" : {
},
"maxTimeMS" : 60000
},
"client" : "xxx.xxx.xxx.xxx",
"desc" : "conn56556",
"threadId" : "0x7f96e1cf6700",
"connectionId" : 56556,
"waitingForLock" : false,
"numYields" : 4111,
"lockStats" : {
"timeLockedMicros" : {
"r" : NumberLong(16472467),
"w" : NumberLong(0)
},
"timeAcquiringMicros" : {
"r" : NumberLong(106194),
"w" : NumberLong(0)
}
}
}
]
}
-
此查询的
maxTimeMS为 60 秒(60,000 毫秒),并且持续了 105 秒。在我看来,这很荒谬。 Mongo 在 60 秒内杀死它的时间不应超过 2、3 秒。 -
有人可以确认这是否是 Mongo 的预期行为吗?
【问题讨论】:
标签: mongodb