How allowDiskUse is executed

176 views
Skip to first unread message

Przemysław Wojnowski

unread,
Apr 20, 2016, 9:27:27 AM4/20/16
to mongodb-user
Hello,

In docs for "allowDiskUse" there is:
"Enables writing to temporary files. When set to true, aggregation stages can write data to the _tmp subdirectory in the dbPath directory."

Does it mean that setting the option to "true" will make pipeline stages to always use the disk or only when a stage exceeds 100MB limit?

Thanks!

Przemysław Wojnowski

unread,
Apr 28, 2016, 6:55:15 AM4/28/16
to mongodb-user
Anyone knows?

Rhys Campbell

unread,
Apr 28, 2016, 10:29:22 AM4/28/16
to mongodb-user
https://docs.mongodb.org/manual/reference/command/aggregate/

"Optional. Enables writing to temporary files. When set to true, aggregation stages can write data to the _tmp subdirectory in the dbPath directory."

Says can here so that's must mean only if it needs to. Related note take a look at this optimization...

Markus Thielsch

unread,
Apr 29, 2016, 2:14:12 AM4/29/16
to mongodb-user
Hi Przemysław,

When the [`allowDiskUse` parameter](https://docs.mongodb.org/manual/reference/command/aggregate/#aggregate-data-using-external-sort) is set to `true` MongoDB will only start using the local disk once the RAM limit is exceeded.

For more general information on limitations have a look at the [Memory Restrictions documentation](https://docs.mongodb.org/manual/core/aggregation-pipeline-limits/#memory-restrictions).

Regards,
Markus
Reply all
Reply to author
Forward
0 new messages