- Reference >
- MongoDB Server Parameters
MongoDB Server Parameters¶
On this page
Synopsis¶
MongoDB provides a number of configuration options that are accessible
via the setParameter
command or the
--setParameter
option.
For additional configuration options, see Configuration File Options and Manual Page for mongod.
Parameters¶
Authentication Parameters¶
-
authenticationMechanisms
¶ Changed in version 2.6: Added support for the
PLAIN
andMONGODB-X509
authentication mechanisms.Changed in version 3.0: Added support for the
SCRAM-SHA-1
authentication mechanism.Available for both
mongod
andmongos
.Specifies the list of authentication mechanisms the server accepts. Set this to one or more of the following values. If you specify multiple values, use a comma-separated list and no spaces. For descriptions of the authentication mechanisms, see Authentication.
Value Description SCRAM-SHA-1 RFC 5802 standard Salted Challenge Response Authentication Mechanism using the SHA-1 hash function. MONGODB-CR MongoDB challenge/response authentication. MONGODB-X509 MongoDB TLS/SSL certificate authentication. GSSAPI (Kerberos) External authentication using Kerberos. This mechanism is available only in MongoDB Enterprise. PLAIN (LDAP SASL) PLAIN
transmits passwords in plain text. Required for LDAP Proxy Authentication. Optional for authenticating non-$external
users.For example, to specify
PLAIN
as the authentication mechanism, use the following command:mongod --setParameter authenticationMechanisms=PLAIN --auth
-
clusterAuthMode
¶ New in version 2.6.
Available for both
mongod
andmongos
.Set the
clusterAuthMode
to eithersendX509
orx509
. Useful during rolling upgrade to use x509 for membership authentication to minimize downtime.Changed in version 3.0: Most MongoDB distributions include support for TLS/SSL. See Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients for more information about TLS/SSL and MongoDB.
Changed in version 3.4: If
--sslCAFile
is not specified when connecting to an TLS/SSL-enabled server, the system-wide CA certificate store will be used.db.adminCommand( { setParameter: 1, clusterAuthMode: "sendX509" } )
-
enableLocalhostAuthBypass
¶ New in version 2.4.
Available for both
mongod
andmongos
.Specify
0
orfalse
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.See Localhost Exception for more information.
-
ldapUserCacheInvalidationInterval
¶ For use with MongoDB servers using LDAP Authorization.
The interval (in seconds) MongoDB waits between external user cache flushes. After MongoDB flushes the external user cache, the next operation an LDAP-authorized user, MongoDB reacquires authorization data from the LDAP server.
Increasing the value specified increases the amount of time MongoDB and the LDAP server can be out of sync, but reduces the load on the LDAP server. Conversely, decreasing the value specified decreases the time MongoDB and the LDAP server can be out of sync while increasing the load on the LDAP server.
Defaults to 30 seconds.
-
opensslCipherConfig
¶ New in version 3.4.7.
Specify the cipher string for OpenSSL when using TLS/SSL encryption. For a list of cipher strings, see https://wiki.openssl.org/index.php/Manual:Ciphers(1)#CIPHER_STRINGS
You can only set
opensslCipherConfig
during start-up, and cannot change this setting using thesetParameter
database command.mongod --setParameter opensslCipherConfig=HIGH:!EXPORT:!aNULL@STRENGTH --sslMode requireSSL --sslPEMKeyFile Certs/server.pem
-
saslauthdPath
¶ Note
Available only in MongoDB Enterprise (except MongoDB Enterprise for Windows).
Available for both
mongod
andmongos
.Specify the path to the Unix Domain Socket of the
saslauthd
instance to use for proxy authentication.
-
saslHostName
¶ New in version 2.4.
Available for both
mongod
andmongos
.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. For Linux systems, see Configure MongoDB with Kerberos Authentication on Linux for more information.
-
saslServiceName
¶ New in version 2.4.6.
Available for both
mongod
andmongos
.Allows users to override the default Kerberos service name component of the Kerberos principal name, on a per-instance basis. If unspecified, the default value is
mongodb
.MongoDB only permits setting
saslServiceName
at startup. ThesetParameter
command can not change this setting.saslServiceName
is only available in MongoDB Enterprise.Important
Ensure that your driver supports alternate service names.
-
scramIterationCount
¶ New in version 3.0.0.
Default:
10000
Available for both
mongod
andmongos
.Changes the number of hashing iterations used for all new stored passwords. More iterations increase the amount of time required for clients to authenticate to MongoDB, but makes passwords less susceptible to brute-force attempts. The default value is ideal for most common use cases and requirements. If you modify this value, it does not change the number of iterations for existing passwords.
You can set
scramIterationCount
when starting MongoDB or on runningmongod
instances.
-
sslMode
¶ New in version 2.6.
Available for both
mongod
andmongos
.Set the
net.ssl.mode
to eitherpreferSSL
orrequireSSL
. Useful during rolling upgrade to TLS/SSL to minimize downtime.Changed in version 3.0: Most MongoDB distributions include support for TLS/SSL. See Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients for more information about TLS/SSL and MongoDB.
Changed in version 3.4: If
--sslCAFile
is not specified when connecting to an TLS/SSL-enabled server, the system-wide CA certificate store will be used.db.adminCommand( { setParameter: 1, sslMode: "preferSSL" } )
-
userCacheInvalidationIntervalSecs
¶ Default: 30.
Available for
mongos
only.On a
mongos
instance, specifies the interval (in seconds) at which themongos
instance checks to determine whether the in-memory cache of user objects has stale data, and if so, clears the cache. If there are no changes to user objects,mongos
will not clear the cache.This parameter has a minimum value of
1
second and a maximum value of86400
seconds (24 hours).Changed in version 3.0: Default value has changed to
30
seconds, and the minimum value allowed has changed to1
second.mongos
only clears the user cache if there are changes.
General Parameters¶
-
connPoolMaxShardedConnsPerHost
¶ New in version 2.6.
Default: 200
Available for both
mongod
andmongos
.Set the maximum size of the connection pools for communication to the shards. The size of a pool does not prevent the creation of additional connections, but does prevent the connection pools from retaining connections above this limit.
Note
The parameter is separate from the connections in TaskExecutor pools. See
ShardingTaskExecutorPoolMaxSize
.Increase the
connPoolMaxShardedConnsPerHost
value only if the number of connections in a connection pool has a high level of churn or if the total number of created connections increase.You can only set
connPoolMaxShardedConnsPerHost
during startup in the config file or on the command line, as follows to increase the size of the connection pool:mongos --setParameter connPoolMaxShardedConnsPerHost=250
-
connPoolMaxConnsPerHost
¶ New in version 2.6.
Default: 200
Available for both
mongod
andmongos
.Set the maximum size of the connection pools for outgoing connections to other
mongod
instances. The size of a pool does not prevent the creation of additional connections, but does prevent a connection pool from retaining connections in excess of the value ofconnPoolMaxConnsPerHost
.Note
The parameter is separate from the connections in TaskExecutor pools. See
ShardingTaskExecutorPoolMaxSize
.Only adjust this setting if your driver does not pool connections and you’re using authentication in the context of a sharded cluster.
You can only set
connPoolMaxConnsPerHost
during startup in the config file or on the command line, as in the following example:mongod --setParameter connPoolMaxConnsPerHost=250
-
cursorTimeoutMillis
¶ New in version 3.0.2.
Default: 600000 (i.e. 10 minutes)
Available for both
mongod
andmongos
.Sets the expiration threshold in milliseconds for idle cursors before MongoDB removes them; i.e. MongoDB removes cursors that have been idle for the specified
cursorTimeoutMillis
.For example, the following sets the
cursorTimeoutMillis
to300000
milliseconds (i.e. 5 minutes).mongod --setParameter cursorTimeoutMillis=300000
Or, if using the
setParameter
command within themongo
shell:db.adminCommand( { setParameter: 1, cursorTimeoutMillis: 300000 } )
-
failIndexKeyTooLong
¶ New in version 2.6.
Available for
mongod
only.In MongoDB 2.6, if you attempt to insert or update a document so that the value of an indexed field is longer than the
Index Key Length Limit
, the operation will fail and return an error to the client. In previous versions of MongoDB, these operations would successfully insert or modify a document but the index or indexes would not include references to the document.To avoid this issue, consider using hashed indexes or indexing a computed value. If you have an existing data set and want to disable this behavior so you can upgrade and then gradually resolve these indexing issues, you can use
failIndexKeyTooLong
to disable this behavior.failIndexKeyTooLong
defaults totrue
. Whenfalse
, a 2.6mongod
instance will provide the 2.4 behavior.Issue the following command to disable the index key length validation: for a running:program:mongod instance:
db.adminCommand( { setParameter: 1, failIndexKeyTooLong: false } )
You can also set
failIndexKeyTooLong
at startup time with the following option:mongod --setParameter failIndexKeyTooLong=false
-
newCollectionsUsePowerOf2Sizes
¶ Deprecated since version 3.0.0: MongoDB deprecates the
newCollectionsUsePowerOf2Sizes
parameter such that you cannot set thenewCollectionsUsePowerOf2Sizes
tofalse
andnewCollectionsUsePowerOf2Sizes
set totrue
is a no-op. To disable the power of 2 allocation for a collection, use thecollMod
command with thenoPadding
flag or thedb.createCollection()
method with thenoPadding
option.Default:
true
.Available for
mongod
only.Available for the MMAPv1 storage engine only.
-
notablescan
¶ Available for
mongod
only.Specify whether all queries must use indexes. If
1
, MongoDB will not execute queries that require a collection scan and will return an error.Consider the following example which sets
notablescan
to1
or true:db.adminCommand( { setParameter: 1, notablescan: 1 } )
Setting
notablescan
to1
can be useful for testing application queries, for example, to identify queries that scan an entire collection and cannot use an index.To detect unindexed queries without
notablescan
, consider reading the Evaluate Performance of Current Operations and Optimize Query Performance sections and using thelogLevel
parameter, mongostat and profiling.Don’t run production
mongod
instances withnotablescan
because preventing collection scans can potentially affect queries in all databases, including administrative queries.
-
ttlMonitorEnabled
¶ New in version 2.4.6.
Available for
mongod
only.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:db.adminCommand( { setParameter: 1, ttlMonitorEnabled: false } )
Alternately, you may disable the thread at startup time by starting the
mongod
instance with the following option:mongod --setParameter ttlMonitorEnabled=false
-
disableJavaScriptJIT
¶ New in version 3.2.
Available for
mongod
only.The MongoDB JavaScript engine uses SpiderMonkey, which implements Just-in-Time (JIT) compilation for improved performance when running scripts.
To disable the JIT, set
disableJavaScriptJIT
totrue
, as in the following example:db.adminCommand( { setParameter: 1, disableJavaScriptJIT: true } )
Be aware that
group
and$where
will reuse existing JavaScript interpreter contexts, so changes todisableJavaScriptJIT
may not take effect immediately for these operations.Alternately, you may disable the JIT at startup time by starting the
mongod
instance with the following option:mongod --setParameter disableJavaScriptJIT=true
-
maxIndexBuildMemoryUsageMegabytes
¶ New in version 3.4.
Default: 500
Limits the amount of memory that simultaneous foreground index builds on one collection may consume for the duration of the builds.
Foreground index builds may be initiated either by a user command such as Create Index or by an administrative process such as an initial sync. Both are subject to the limit set by
maxIndexBuildMemoryUsageMegabytes
.An initial sync operation populates only one collection at a time and has no risk of exceeding the memory limit. However, it is possible for a user to start foreground index builds on multiple collections in multiple databases simultaneously and potentially consume an amount of memory greater than the limit set in
maxIndexBuildMemoryUsageMegabytes
.
-
watchdogPeriodSeconds
¶ New in version 3.4.7.
Available for
mongod
only.Type: integer
Default: -1 (disabled)
Note
Available only in MongoDB Enterprise. Not available on macOS.
Determines how often the Storage Node Watchdog checks the status of the monitored filesystems.
Note
If a filesystem on a monitored directory becomes unresponsive, it can take a maximum of nearly twice the value of
watchdogPeriodSeconds
to terminate themongod
.Valid values are -1, meaning the Storage Node Watchdog is disabled, or an integer greater than or equal to 60.
By default the Storage Node Watchdog is disabled. To enable it,
watchdogPeriodSeconds
must be set at startup time.mongod --setParameter watchdogPeriodSeconds=60
You can only enable the Storage Node Watchdog at startup.
However, once enabled, you can pause the Storage Node Watchdog or change the
watchdogPeriodSeconds
during runtime.To pause the Storage Node Watchdog during runtime, set
watchdogPeriodSeconds
to -1.db.adminCommand( { setParameter: 1, watchdogPeriodSeconds: -1 } )
To resume or change the period during runtime, set
watchdogPeriodSeconds
to a number greater than or equal to 60.db.adminCommand( { setParameter: 1, watchdogPeriodSeconds: 120 } )
Note
It is an error to set
watchdogPeriodSeconds
at runtime if the Storage Node Watchdog was not enabled at startup time.
Logging Parameters¶
-
logLevel
¶ Available for both
mongod
andmongos
.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
:db.adminCommand( { setParameter: 1, logLevel: 2 } )
The default
logLevel
is0
.See also
-
logComponentVerbosity
¶ New in version 3.0.0.
Available for both
mongod
andmongos
.Sets the verbosity levels of various components for log messages. The verbosity level determines the amount of Informational and Debug messages MongoDB outputs.
The verbosity level can range from
0
to5
:0
is the MongoDB’s default log verbosity level, to include Informational messages.1
to5
increases the verbosity level to include Debug messages.
For a component, you can also specify
-1
to inherit the parent’s verbosity level.To specify the verbosity level, use a document similar to the following:
{ verbosity: <int>, <component1>: { verbosity: <int> }, <component2>: { verbosity: <int>, <component3>: { verbosity: <int> } }, ... }
For the components, you can specify just the
<component>: <int>
in the document, unless you are setting both the parent verbosity level and that of the child component(s) as well:{ verbosity: <int>, <component1>: <int> , <component2>: { verbosity: <int>, <component3>: <int> } ... }
The top-level
verbosity
field corresponds tosystemLog.verbosity
which sets the default level for all components. The default value ofsystemLog.verbosity
is0
.The components correspond to the following settings:
accessControl
command
control
geo
index
network
query
replication
sharding
storage
storage.journal
write
Unless explicitly set, the component has the verbosity level of its parent. For example,
storage
is the parent ofstorage.journal
. That is, if you specify astorage
verbosity level, this level also applies tostorage.journal
components unless you specify the verbosity level forstorage.journal
.For example, the following sets the
default verbosity level
to1
, thequery
to2
, thestorage
to2
, and thestorage.journal
to1
.db.adminCommand( { setParameter: 1, logComponentVerbosity: { verbosity: 1, query: { verbosity: 2 }, storage: { verbosity: 2, journal: { verbosity: 1 } } } } )
You can also set parameter
logComponentVerbosity
at startup time, passing the verbosity level document as a string.mongo
shell also provides thedb.setLogLevel()
to set the log level for a single component. For various ways to set the log verbosity level, see Configure Log Verbosity Levels.
-
logUserIds
¶ New in version 2.4.
Available for both
mongod
andmongos
.Specify
1
to enable logging of userids.Disabled by default.
-
quiet
¶ Available for both
mongod
andmongos
.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
:db.adminCommand( { setParameter: 1, quiet: 1 } )
See also
-
traceExceptions
¶ Available for both
mongod
andmongos
.Configures
mongod
to log full source code stack traces for every database and socket C++ exception, for use with debugging. Iftrue
,mongod
will log full stack traces.Consider the following example which sets the
traceExceptions
totrue
:db.adminCommand( { setParameter: 1, traceExceptions: true } )
See also
Diagnostic Parameters¶
To support the diagnostic data capture, MongoDB introduces the following parameters:
Note
The default values for the diagnostic data capture interval and the maximum sizes are chosen to provide useful data to MongoDB engineers with minimal impact on performance and storage size. Typically, these values will only need modifications as requested by MongoDB engineers for specific diagnostic purposes.
Diagnostic data files are stored in the diagnostic.data
directory
under the mongod
instance’s --dbpath
or
storage.dbPath
.
-
diagnosticDataCollectionEnabled
¶ New in version 3.2.
Type: boolean
Default: true
Available for
mongod
only.Determines whether to enable the collecting and logging of data for diagnostic purposes. Diagnostic logging is enabled by default.
For example, the following disables the diagnostic collection:
mongod --setParameter diagnosticDataCollectionEnabled=false
-
diagnosticDataCollectionDirectorySizeMB
¶ New in version 3.2.
Changed in version 3.4: Increased default size to 200 megabytes.
Type: integer
Default: 200
Available for
mongod
only.Specifies the maximum size, in megabytes, of the
diagnostic.data
directory . If directory size exceeds this number, the oldest diagnostic files in the directory are automatically deleted based on the timestamp in the file name.For example, the following sets the maximum size of the directory to
250
megabytes:mongod --setParameter diagnosticDataCollectionDirectorySizeMB=250
The minimum value for
diagnosticDataCollectionDirectorySizeMB
is10
megabytes.diagnosticDataCollectionDirectorySizeMB
must be greater than maximum diagnostic file sizediagnosticDataCollectionFileSizeMB
.
-
diagnosticDataCollectionFileSizeMB
¶ New in version 3.2.
Type: integer
Default: 10
Available for
mongod
only.Specifies the maximum size, in megabytes, of each diagnostic file. If the file exceeds the maximum file size, MongoDB creates a new file.
For example, the following sets the maximum size of each diagnostic file to
20
megabytes:mongod --setParameter diagnosticDataCollectionFileSizeMB=20
The minimum value for
diagnosticDataCollectionFileSizeMB
is1
megabyte.
-
diagnosticDataCollectionPeriodMillis
¶ New in version 3.2.
Type: integer
Default: 1000
Available for
mongod
only.Specifies the interval, in milliseconds, at which to collect diagnostic data.
For example, the following sets the interval to
5000
milliseconds or 5 seconds:mongod --setParameter diagnosticDataCollectionPeriodMillis=5000
The minimum value for
diagnosticDataCollectionPeriodMillis
is100
milliseconds.
Replication Parameters¶
-
replApplyBatchSize
¶ Available for
mongod
only.Specify the number of oplog entries to apply as a single batch.
replApplyBatchSize
must be an integer between 1 and 1024. The default value is 1. This option only applies to master/slave configurations and is valid only on amongod
started with the--slave
command line option.Batch sizes must be
1
for members withslavedelay
configured.
-
replIndexPrefetch
¶ Available for
mongod
only.Use
replIndexPrefetch
in conjunction withreplSetName
when configuring a replica set. 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.
-
replWriterThreadCount
¶ New in version 3.2.
Type: integer
Default: 16
Available for
mongod
only.Number of threads to use to apply replicated operations in parallel. Values can range from 1 to 256 inclusive. You can only set
replWriterThreadCount
at startup and cannot change this setting with thesetParameter
command.
Sharding Parameters¶
-
recoverShardingState
¶ Available for
mongod
only.Specify a boolean to check or ignore sharding state recovery information. Default is
true
to check the sharding state recovery information.
-
replMonitorMaxFailedChecks
¶ Available in MongoDB 3.2 only
Type: integer
Default: 30
The number of times the
mongod
ormongos
instance tries to reach the replica sets in the sharded cluster (e.g. shard replica sets, config server replica set) to monitor the replica set status and topology.When the number of consecutive unsuccessful attempts exceeds this parameter value, the
mongod
ormongos
instance denotes the monitored replica set as unavailable. If the monitored replica set is the config server replica set:- For MongoDB 3.2.0-3.2.9, the monitoring
mongod
ormongos
instance will become unusable and needs to be restarted. See the troubleshooting guide for more details. - For MongoDB 3.2.10 and later 3.2-series, see also
timeOutMonitoringReplicaSets
.
- For MongoDB 3.2.0-3.2.9, the monitoring
-
timeOutMonitoringReplicaSets
¶ Available in MongoDB 3.2.10 and later 3.2-series only
Type: integer
Default: false
The flag that determines whether the
mongod
ormongos
instance should stop its attempt to reach the monitored replica set after unsuccessfully tryingreplMonitorMaxFailedChecks
number of times.If the monitored replica set is the config server replica set and
timeOutMonitoringReplicaSets
is set totrue
, you must restartmongod
ormongos
if themongod
ormongos
instance cannot reach any of the config servers for the specified number of times. See the troubleshooting guide for more details.
-
ShardingTaskExecutorPoolHostTimeoutMS
¶ Type: integer
Default: 300000 (i.e. 5 minutes)
Available for
mongos
only.Maximum time that
mongos
goes without communication to a host beforemongos
drops all connections to the host.You can only set this parameter during start-up and cannot change this setting using the
setParameter
database command.mongos --setParameter ShardingTaskExecutorPoolHostTimeoutMS=120000
-
ShardingTaskExecutorPoolMaxConnecting
¶ New in version 3.4.6.
Type: integer
Default: 264 - 1
Available for
mongos
only.Maximum number of simultaneous initiating connections (including pending connections in setup/refresh state) each TaskExecutor connection pool can have to a
mongod
instance. You can set this parameter to control the rate at whichmongos
adds connections to amongod
instance.If set,
ShardingTaskExecutorPoolMaxConnecting
should be less than or equal toShardingTaskExecutorPoolMaxSize
. If it is greater,mongos
ignores theShardingTaskExecutorPoolMaxConnecting
value.You can only set this parameter during start-up and cannot change this setting using the
setParameter
database command.mongos --setParameter ShardingTaskExecutorPoolMaxConnecting=20
-
ShardingTaskExecutorPoolMaxSize
¶ Type: integer
Default: 264 - 1
Available for
mongos
only.Maximum number of outbound connections each TaskExecutor connection pool can open to any given
mongod
instance. The maximum possible connections to any given host across all TaskExecutor pools is:ShardingTaskExecutorPoolMaxSize * taskExecutorPoolSize
You can only set this parameter during start-up and cannot change this setting using the
setParameter
database command.mongos --setParameter ShardingTaskExecutorPoolMaxSize=4
mongos
can have up ton
TaskExecutor connection pools, wheren
is the number of cores. SeetaskExecutorPoolSize
.See also
ShardingTaskExecutorPoolMinSize
-
ShardingTaskExecutorPoolMinSize
¶ Type: integer
Default: 1
Available for
mongos
only.Minimum number of outbound connections each TaskExecutor connection pool can open to any given
mongod
instance.ShardingTaskExecutorPoolMinSize
connections are created the first time a connection to a new host is requested from the pool. While the pool is idle, the pool maintains this number of connections untilShardingTaskExecutorPoolHostTimeoutMS
milliseconds pass without the any application using that pool.You can only set this parameter during start-up and cannot change this setting using the
setParameter
database command.mongos --setParameter ShardingTaskExecutorPoolMinSize=2
mongos
can have up ton
TaskExecutor connection pools, wheren
is the number of cores. SeetaskExecutorPoolSize
.See also
ShardingTaskExecutorPoolMaxSize
-
ShardingTaskExecutorPoolRefreshRequirementMS
¶ Type: integer
Default: 60000 (1 minute)
Available for
mongos
only.Maximum time the
mongos
waits before attempting to heartbeat a resting connection in the pool.You can only set this parameter during start-up and cannot change this setting using the
setParameter
database command.mongos --setParameter ShardingTaskExecutorPoolRefreshRequirementMS=90000
-
ShardingTaskExecutorPoolRefreshTimeoutMS
¶ Type: integer
Default: 20000 (20 seconds)
Available for
mongos
only.Maximum time the
mongos
waits for a heartbeat before timing out the heartbeat.You can only set this parameter during start-up and cannot change this setting using the
setParameter
database command.mongos --setParameter ShardingTaskExecutorPoolRefreshTimeoutMS=30000
-
taskExecutorPoolSize
¶ Type: integer
Default: Number of cores
Available for
mongos
only.The number of Task Executor connection pools to use for a given
mongos
. The parameter has a minimum value of4
and a maximum value of64
.You can only set this parameter during start-up and cannot change this setting using the
setParameter
database command.mongos --setParameter taskExecutorPoolSize=6
See also
ShardingTaskExecutorPoolMaxSize
ShardingTaskExecutorPoolMinSize
Storage Parameters¶
-
journalCommitInterval
¶ Available for
mongod
only.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:db.adminCommand( { setParameter: 1, journalCommitInterval: 200 } )
See also
-
syncdelay
¶ Available for
mongod
only.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:db.adminCommand( { setParameter: 1, syncdelay: 60 } )
See also
syncPeriodSecs
andjournalCommitInterval
.
WiredTiger Parameters¶
-
wiredTigerConcurrentReadTransactions
¶ New in version 3.0.0.
Available for
mongod
only.Available for the WiredTiger storage engine only.
Specify the maximum number of concurrent read transactions allowed into the WiredTiger storage engine.
db.adminCommand( { setParameter: 1, wiredTigerConcurrentReadTransactions: <num> } )
See also
-
wiredTigerConcurrentWriteTransactions
¶ New in version 3.0.0.
Available for
mongod
only.Available for the WiredTiger storage engine only.
Specify the maximum number of concurrent write transactions allowed into the WiredTiger storage engine.
db.adminCommand( { setParameter: 1, wiredTigerConcurrentWriteTransactions: <num> } )
See also
-
wiredTigerEngineRuntimeConfig
¶ New in version 3.0.0.
Available for
mongod
only.Specify
wiredTiger
storage engine configuration options for a runningmongod
instance. You can only set this parameter using thesetParameter
command and not using the command line or configuration file option.Consider the following operation prototype:
db.adminCommand({ "setParameter": 1, "wiredTigerEngineRuntimeConfig": "<option>=<setting>,<option>=<setting>" })
See the WiredTiger documentation for all available WiredTiger configuration options.
Auditing Parameters¶
-
auditAuthorizationSuccess
¶ New in version 2.6.5.
Default:
false
Note
Available only in MongoDB Enterprise.
Available for both
mongod
andmongos
.Enables the auditing of authorization successes for the authCheck action.
When
auditAuthorizationSuccess
isfalse
, the audit system only logs the authorization failures forauthCheck
.To enable the audit of authorization successes, issue the following command:
db.adminCommand( { setParameter: 1, auditAuthorizationSuccess: true } )
Enabling
auditAuthorizationSuccess
degrades performance more than logging only the authorization failures.
See also