- Reference >
mongod
Parameters
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
0
to disable localhost authentication bypass. Enabled by default.enableLocalhostAuthBypass
is not available usingsetParameter
database command. Use thesetParameter
option in the configuration file or the--setParameter
option on the command line.
-
journalCommitInterval
¶ Specify an integer between
1
and500
signifying the number of milliseconds (ms) between journal commits.Consider the following example which sets the
journalCommitInterval
to200
ms:See also
-
logUserIds
¶ New in version 2.4.
Specify
1
to enable logging of userids.Disabled by default.
-
logLevel
¶ Specify an integer between
0
and5
signifying the verbosity of the logging, where5
is the most verbose.Consider the following example which sets the
logLevel
to2
: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
notablescan
to true:See also
-
replIndexPrefetch
¶ New in version 2.2.
Use
replIndexPrefetch
in conjunction withreplSet
. The default value isall
and available options are:none
all
_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
_id
index. Specify_id_only
ornone
to prevent themongod
from loading any index into memory.
-
replApplyBatchSize
¶ New in version 2.4.
Specify the number of oplog entries to apply as a single batch.
replApplyBatchSize
must 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
1
for members withslaveDelay
configured.
-
saslHostName
¶ New in version 2.4.
saslHostName
overrides MongoDB’s default hostname detection for the purpose of configuring SASL and Kerberos authentication.saslHostName
does not affect the hostname of themongod
ormongos
instance for any purpose beyond the configuration of SASL and Kerberos.You can only set
saslHostName
during start-up, and cannot change this setting using thesetParameter
database command.Note
saslHostName
supports Kerberos authentication and is only included in MongoDB Enterprise. See Deploy MongoDB with Kerberos Authentication for more information.
-
supportCompatibilityFormPrivilegeDocuments
¶ New in version 2.4.
supportCompatibilityFormPrivilegeDocuments
is not available usingsetParameter
database command. Use thesetParameter
option in the configuration file or the--setParameter
option on the command line.
-
syncdelay
¶ Specify the interval in seconds between fsync operations where
mongod
flushes its working memory to disk. By default,mongod
flushes 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
syncdelay
to60
seconds:
-
traceExceptions
¶ New in version 2.2.
Configures
mongod
log full stack traces on assertions or errors. If1
,mongod
will log full stack traces on assertions or errors.Consider the following example which sets the
traceExceptions
totrue
:See also
-
quiet
¶ Sets quiet logging mode. If
1
,mongod
will go into a quiet logging mode which will not log the following events/activities:- connection events;
- the
drop
command, thedropIndexes
command, thediagLogging
command, thevalidate
command, and theclean
command; and - replication synchronization activities.
Consider the following example which sets the
quiet
to1
: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
text
indexes, and you cannot perform text searches. However, MongoDB will continue to maintain existingtext
indexes.
-
releaseConnectionsAfterResponse
¶ New in version 2.2.4: and 2.4.2
Changes the behavior of the connection pool that
mongos
uses to connect to the shards. As a result, eachmongos
should need to maintain fewer connections to each shard. When enabled, themongos
will 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,
releaseConnectionsAfterResponse
will affect the meaning ofgetLastError
.If an application allows read operations in between write operations and
getLastError
calls, the resultinggetLastError
will 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
mongos
instance with the following run-time option:To change this policy for the entire cluster, you must set
releaseConnectionsAfterResponse
on eachmongos
instance in the cluster.
-
ttlMonitorEnabled
¶ New in version 2.4.6.
To support TTL Indexes,
mongod
instances have a background thread that is responsible for deleting documents from collections with TTL indexes.To disable this worker thread for a
mongod
, setttlMonitorEnabled
tofalse
, as in the following operations:Alternately, you may disable the thread at run-time by starting the
mongod
instance with the following option: