patternMinor
Set mongodb's `maxIndexBuildMemoryUsageMegabytes` setting in conf file
Viewed 0 times
conffilemongodbmaxindexbuildmemoryusagemegabytessettingset
Problem
In the mongodb documentation for the configuration options it says that I can specify how much RAM index building will consume:
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
This is done like this:
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.
How can I specify this setting from the mongod.conf file?
maxIndexBuildMemoryUsageMegabytes: Limits the amount of memorythat 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.
How can I specify this setting from the mongod.conf file?
Solution
The different approaches for configuring
You can use
For example:
To confirm this setting has taken effect via the
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:
setParameter:
maxIndexBuildMemoryUsageMegabytes: 700To confirm this setting has taken effect via the
mongo shell, use either of:// Check the parameter values parsed from config file or command-line options
db.serverCmdLineOpts().parsed.setParameter
// Check the current setting of the maxIndexBuildMemoryUsageMegabytes parameter
db.adminCommand({getParameter: 1, maxIndexBuildMemoryUsageMegabytes: 1})Code Snippets
setParameter:
maxIndexBuildMemoryUsageMegabytes: 700// Check the parameter values parsed from config file or command-line options
db.serverCmdLineOpts().parsed.setParameter
// Check the current setting of the maxIndexBuildMemoryUsageMegabytes parameter
db.adminCommand({getParameter: 1, maxIndexBuildMemoryUsageMegabytes: 1})Context
StackExchange Database Administrators Q#233649, answer score: 4
Revisions (0)
No revisions yet.