In the mongodb documentation for the configuration options it says that I can specify how much RAM index building will consume:
maxIndexBuildMemoryUsageMegabytes
: Limits the amount of memory
that simultaneous foreground index builds on one collection may
consume for the duration of the builds.
This setting is set after starting the server by executing an administrative command called setParameter
.
This is done like this:
mongo --eval "db.adminCommand({setParameter: 1, maxIndexBuildMemoryUsageMegabytes: 700})"
I would like to specify this amount when the server starts up by putting it in the Configuration File Options. The documentation does not seem to include this option.
Best Answer
The different approaches for configuring
setParameter
options (via runtime admin command, config file setting, or command-line option) are listed in the Synopsis section at the top of the MongoDB Server Parameters page you referenced.You can use
setParameter
key/value pairs in the YAML configuration file.For example:
To confirm this setting has taken effect via the
mongo
shell, use either of: