【问题标题】:DocumentDB long running query times out even with maxTimeMS:0即使使用 maxTimeMS:0,DocumentDB 长时间运行的查询也会超时
【发布时间】:2019-06-12 09:46:45
【问题描述】:

我正在尝试使用 500M 文档 (1Tb) 查询 documentDB。

var t1 = Date.now();
'Total X Records:';
db.runCommand({aggregate: "house",
pipeline: [{$project: {'_id': 1, 'foo.x': 1}},
{$match: {'foo.x.y': {$in: ['2018-12-15']}}},
{$unwind: '$foo.x'},
{$match: {'foo.x.y': {$in: ['2018-12-15']}}},
{$group: {'_id': null, 'count': {$sum: 1}}}],
cursor:{},
allowDiskUse: true,
maxTimeMS:0
});

var t2 = Date.now();
print("Time in ms: ")
print(t2-t1);

同样的查询在 mongo cluster (10 mongod) ~1hr 中运行。

当我在 DocumentDB 中运行相同的查询时(6 个实例 db.r4.xlarge) 它会在 2 小时后引发错误。

{ "ok" : 0, "errmsg" : "operation was interrupted", "code" : 11601 }
Time in ms: 
7226913
bye

【问题讨论】:

    标签: aws-documentdb-mongoapi aws-documentdb


    【解决方案1】:

    使用默认设置,AWS DocumentDB 查询会在 2 小时后超时。截至目前,它们目前不支持 maxTimeMS 设置。

    【讨论】:

    • 文档中还没有,我直接与 AWS 技术团队合作,他们很快就会在他们的说明中发布它。
    【解决方案2】:

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-05
    • 1970-01-01
    • 1970-01-01
    • 2014-09-17
    • 2018-06-23
    • 2020-05-22
    • 2020-04-27
    • 2014-05-15
    相关资源
    最近更新 更多