- Reference >
mongodParameters
mongod Parameters¶
On this page
Changed in version 2.4.
Synopsis¶
MongoDB provides a number of configuration options that are accessible
via the --setParameter option to
mongod. This document documents all of these options.
For additional run time configuration options, see Configuration File Options and Manual Page for mongod.
Parameters¶
-
enableLocalhostAuthBypass¶ New in version 2.4.
Specify
0to disable localhost authentication bypass. Enabled by default.enableLocalhostAuthBypassis not available usingsetParameterdatabase command. Use thesetParameteroption in the configuration file or the--setParameteroption on the command line.
-
journalCommitInterval¶ Specify an integer between
1and500signifying the number of milliseconds (ms) between journal commits.Consider the following example which sets the
journalCommitIntervalto200ms:See also
-
logUserIds¶ New in version 2.4.
Specify
1to enable logging of userids.Disabled by default.
-
logLevel¶ Specify an integer between
0and5signifying the verbosity of the logging, where5is the most verbose.Consider the following example which sets the
logLevelto2:See also
-
notablescan¶ Specify whether queries must use indexes. If
1, queries that perform a table scan instead of using an index will fail.Consider the following example which sets
notablescanto true:See also
-
replIndexPrefetch¶ New in version 2.2.
Use
replIndexPrefetchin conjunction withreplSet. The default value isalland available options are:noneall_id_only
By default secondary members of a replica set will load all indexes related to an operation into memory before applying operations from the oplog. You can modify this behavior so that the secondaries will only load the
_idindex. Specify_id_onlyornoneto prevent themongodfrom loading any index into memory.
-
replApplyBatchSize¶ New in version 2.4.
Specify the number of oplog entries to apply as a single batch.
replApplyBatchSizemust be an integer between 1 and 1024. This option only applies to replica set members when they are in the secondary state.Batch sizes must be
1for members withslaveDelayconfigured.
-
saslHostName¶ New in version 2.4.
saslHostNameoverrides MongoDB’s default hostname detection for the purpose of configuring SASL and Kerberos authentication.saslHostNamedoes not affect the hostname of themongodormongosinstance for any purpose beyond the configuration of SASL and Kerberos.You can only set
saslHostNameduring start-up, and cannot change this setting using thesetParameterdatabase command.Note
saslHostNamesupports Kerberos authentication and is only included in MongoDB Enterprise. See Deploy MongoDB with Kerberos Authentication for more information.
-
supportCompatibilityFormPrivilegeDocuments¶ New in version 2.4.
supportCompatibilityFormPrivilegeDocumentsis not available usingsetParameterdatabase command. Use thesetParameteroption in the configuration file or the--setParameteroption on the command line.
-
syncdelay¶ Specify the interval in seconds between fsync operations where
mongodflushes its working memory to disk. By default,mongodflushes memory to disk every 60 seconds. In almost every situation you should not set this value and use the default setting.Consider the following example which sets the
syncdelayto60seconds:
-
traceExceptions¶ New in version 2.2.
Configures
mongodlog full stack traces on assertions or errors. If1,mongodwill log full stack traces on assertions or errors.Consider the following example which sets the
traceExceptionstotrue:See also
-
quiet¶ Sets quiet logging mode. If
1,mongodwill go into a quiet logging mode which will not log the following events/activities:- connection events;
- the
dropcommand, thedropIndexescommand, thediagLoggingcommand, thevalidatecommand, and thecleancommand; and - replication synchronization activities.
Consider the following example which sets the
quietto1:See also
-
textSearchEnabled¶ New in version 2.4.
Warning
- Do not enable or use text search on production systems.
- Text indexes have significant storage requirements and performance costs. See Storage Requirements and Performance Costs for more information.
Enables the text search feature. You must enable the feature before creating or accessing a text index.
If the flag is not enabled, you cannot create new
textindexes, and you cannot perform text searches. However, MongoDB will continue to maintain existingtextindexes.
-
releaseConnectionsAfterResponse¶ New in version 2.2.4: and 2.4.2
Changes the behavior of the connection pool that
mongosuses to connect to the shards. As a result, eachmongosshould need to maintain fewer connections to each shard. When enabled, themongoswill release a connection into the thread pool after each read operation or command.Warning
For applications that do not use the default, journaled, or replica acknowledged write concern modes of the driver,
releaseConnectionsAfterResponsewill affect the meaning ofgetLastError.If an application allows read operations in between write operations and
getLastErrorcalls, the resultinggetLastErrorwill not report on the success of the proceeding write operation.Use with caution.
To enable, use the following command while connected to a
mongos:Alternately, you may start the
mongosinstance with the following run-time option:To change this policy for the entire cluster, you must set
releaseConnectionsAfterResponseon eachmongosinstance in the cluster.
-
ttlMonitorEnabled¶ New in version 2.4.6.
To support TTL Indexes,
mongodinstances have a background thread that is responsible for deleting documents from collections with TTL indexes.To disable this worker thread for a
mongod, setttlMonitorEnabledtofalse, as in the following operations:Alternately, you may disable the thread at run-time by starting the
mongodinstance with the following option: