aws-documentdb-mongoapiaws-documentdb

DocumentDB long running query times out even with maxTimeMS:0


I am trying to query documentDB with 500M documents (1Tb).

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);

The same query runs in mongo cluster (10 mongod) ~1hr.

When I run the same query in DocumentDB (6 instances db.r4.xlarge) it throws an error after 2hr.

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

Solution

  • AWS DocumentDB queries time out after 2 hours with the default settings. They don’t currently support the maxTimeMS setting as of date.