- Reference >
- MongoDB Server Parameters
MongoDB Server Parameters¶
On this page
Synopsis¶
MongoDB provides a number of configuration options that you can set using:
the
setParametercommand:the
setParameterconfiguration setting:the
--setParametercommand-line option formongodandmongos:
For additional configuration options, see
Configuration File Options, mongod and
mongos.
Parameters¶
Authentication Parameters¶
-
authenticationMechanisms¶ Changed in version 2.6: Added support for the
PLAINandMONGODB-X509authentication mechanisms.Changed in version 3.0: Added support for the
SCRAM-SHA-1authentication mechanism.Available for both
mongodandmongos.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) PLAINtransmits passwords in plain text. Required for LDAP Proxy Authentication. Optional for authenticating non-$externalusers.For example, to specify
PLAINas the authentication mechanism, use the following command:
-
clusterAuthMode¶ New in version 2.6.
Available for both
mongodandmongos.Set the
clusterAuthModeto eithersendX509orx509. Useful during rolling upgrade to use x509 for membership authentication to minimize downtime.For more information about TLS/SSL and MongoDB, see Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients .
-
enableLocalhostAuthBypass¶ Available for both
mongodandmongos.Specify
0orfalseto 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.See Localhost Exception for more information.
-
ldapUserCacheInvalidationInterval¶ For use with MongoDB deployments using LDAP Authorization. Available for
mongodinstances only.The interval (in seconds) that the
mongodinstance waits between external user cache flushes. After MongoDB flushes the external user cache, MongoDB reacquires authorization data from the LDAP server the next time an LDAP-authorized user issues an operation.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://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER-STRINGS
You can only set
opensslCipherConfigduring start-up, and cannot change this setting using thesetParameterdatabase command.
-
saslauthdPath¶ Note
Available only in MongoDB Enterprise (except MongoDB Enterprise for Windows).
Available for both
mongodandmongos.Specify the path to the Unix Domain Socket of the
saslauthdinstance to use for proxy authentication.
-
saslHostName¶ Available for both
mongodandmongos.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. For Linux systems, see Configure MongoDB with Kerberos Authentication on Linux for more information.
-
saslServiceName¶ Available for both
mongodandmongos.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
saslServiceNameat startup. ThesetParametercommand can not change this setting.saslServiceNameis only available in MongoDB Enterprise.Important
Ensure that your driver supports alternate service names.
-
scramIterationCount¶ New in version 3.0.0.
Default:
10000Available for both
mongodandmongos.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
scramIterationCountwhen starting MongoDB or on runningmongodinstances.
-
sslMode¶ New in version 2.6.
Available for both
mongodandmongos.Set the
net.ssl.modeto eitherpreferSSLorrequireSSL. Useful during rolling upgrade to TLS/SSL to minimize downtime.For more information about TLS/SSL and MongoDB, see Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients .
-
sslWithholdClientCertificate¶ Default: false
New in version 3.4.18.
Available for both
mongodandmongos.A TLS certificate is set for a
mongodormongoseither by the--sslClusterFileoption or by the--sslPEMKeyFileoption when--sslClusterFileis not set. If the TLS certificate is set, by default, the instance sends the certificate when initiating intra-cluster communications with othermongodormongosinstances in the deployment. SetsslWithholdClientCertificateto1ortrueto direct the instance to withhold sending its TLS certificate during these communications. Use this option with--sslAllowConnectionsWithoutCertificates(to allow inbound connections without certificates) on all members of the deployment.sslWithholdClientCertificateis mutually exclusive with--clusterAuthMode x509.
-
userCacheInvalidationIntervalSecs¶ Default: 30
Available for
mongosonly.On a
mongosinstance, specifies the interval (in seconds) at which themongosinstance 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,mongoswill not clear the cache.This parameter has a minimum value of
1second and a maximum value of86400seconds (24 hours).Changed in version 3.0: Default value has changed to
30seconds, and the minimum value allowed has changed to1second.mongosonly clears the user cache if there are changes.
-
authFailedDelayMs¶ Default: 0
Available for both
mongodandmongos.New in version 3.4.
Enterprise Feature
Available in MongoDB Enterprise only.
The number of milliseconds to wait before informing clients that their authentication attempt has failed. This parameter may be in the range
0to5000, inclusive.Setting this parameter makes brute-force login attacks on a database more time-consuming. However, clients waiting for a response from the MongoDB server still consume server resources, and this may adversely impact benign login attempts if the server is denying access to many other clients simultaneously.
-
allowRolesFromX509Certificates¶ Default: true
Available for both
mongodandmongos.Available starting in MongoDB 3.4.22
A boolean flag that allows or disallows the retrieval of authorization roles from client x.509 certificates.
You can only set
allowRolesFromX509Certificatesduring startup in the config file or on the command line.
General Parameters¶
-
connPoolMaxShardedConnsPerHost¶ New in version 2.6.
Default: 200
Available for both
mongodandmongos.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
connPoolMaxShardedConnsPerHostvalue 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
connPoolMaxShardedConnsPerHostduring startup in the config file or on the command line, as follows to increase the size of the connection pool:
-
connPoolMaxConnsPerHost¶ New in version 2.6.
Default: 200
Available for both
mongodandmongos.Set the maximum size of the connection pools for outgoing connections to other
mongodinstances. 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
connPoolMaxConnsPerHostduring startup in the config file or on the command line, as in the following example:
-
cursorTimeoutMillis¶ New in version 3.0.2.
Default: 600000 (i.e. 10 minutes)
Available for both
mongodandmongos.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
cursorTimeoutMillisto300000milliseconds (i.e. 5 minutes).Or, if using the
setParametercommand within themongoshell:Setting
cursorTimeoutMillisto less than or equal to0results in all cursors being immediately eligible for timeout. Generally, the timeout value should be greater than the average amount of time for a query to return results. Use tools like thecursor.explain()cursor modifier to analyze the average query time and select an appropriate timeout period.
-
failIndexKeyTooLong¶ New in version 2.6.
Available for
mongodonly.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
failIndexKeyTooLongto disable this behavior.failIndexKeyTooLongdefaults totrue. Whenfalse, a 2.6mongodinstance will provide the 2.4 behavior.Issue the following command to disable the index key length validation:
You can also set
failIndexKeyTooLongat startup time with the following option:
-
newCollectionsUsePowerOf2Sizes¶ Deprecated since version 3.0.0: MongoDB deprecates the
newCollectionsUsePowerOf2Sizesparameter such that you cannot set thenewCollectionsUsePowerOf2SizestofalseandnewCollectionsUsePowerOf2Sizesset totrueis a no-op. To disable the power of 2 allocation for a collection, use thecollModcommand with thenoPaddingflag or thedb.createCollection()method with thenoPaddingoption.Default:
true.Available for
mongodonly.Available for the MMAPv1 storage engine only.
-
notablescan¶ Available for
mongodonly.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
notablescanto1or true:Setting
notablescanto1can 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 thelogLevelparameter, mongostat and profiling.Don’t run production
mongodinstances withnotablescanbecause preventing collection scans can potentially affect queries in all databases, including administrative queries.
-
ttlMonitorEnabled¶ Available for
mongodonly.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 startup time by starting the
mongodinstance with the following option:
-
disableJavaScriptJIT¶ New in version 3.2.
Available for
mongodonly.The MongoDB JavaScript engine uses SpiderMonkey, which implements Just-in-Time (JIT) compilation for improved performance when running scripts.
To disable the JIT, set
disableJavaScriptJITtotrue, as in the following example:Be aware that
groupand$wherewill reuse existing JavaScript interpreter contexts, so changes todisableJavaScriptJITmay not take effect immediately for these operations.Alternately, you may disable the JIT at startup time by starting the
mongodinstance with the following option:
-
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.
The memory consumed by an index build is separate from the WiredTiger cache memory (see
cacheSizeGB).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.Tip
To minimize the impact of building an index on replica sets and sharded clusters with replica set shards, use a rolling index build procedure as described on Build Indexes on Replica Sets.
-
watchdogPeriodSeconds¶ New in version 3.4.7.
Available for
mongodonly.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
watchdogPeriodSecondsto 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,
watchdogPeriodSecondsmust be set at startup time.You can only enable the Storage Node Watchdog at startup.
However, once enabled, you can pause the Storage Node Watchdog or change the
watchdogPeriodSecondsduring runtime.To pause the Storage Node Watchdog during runtime, set
watchdogPeriodSecondsto -1.To resume or change the period during runtime, set
watchdogPeriodSecondsto a number greater than or equal to 60.Note
It is an error to set
watchdogPeriodSecondsat runtime if the Storage Node Watchdog was not enabled at startup time.
Logging Parameters¶
-
logLevel¶ Available for both
mongodandmongos.Specify an integer between
0and5signifying the verbosity of the logging, where5is the most verbose.Consider the following example which sets the
logLevelto2:The default
logLevelis0.See also
-
logComponentVerbosity¶ New in version 3.0.0.
Available for both
mongodandmongos.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
0to5:0is the MongoDB’s default log verbosity level, to include Informational messages.1to5increases the verbosity level to include Debug messages.
For a component, you can also specify
-1to inherit the parent’s verbosity level.To specify the verbosity level, use a document similar to the following:
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:The top-level
verbosityfield corresponds tosystemLog.verbositywhich sets the default level for all components. The default value ofsystemLog.verbosityis0.The components correspond to the following settings:
accessControlcommandcontrolgeoindexnetworkqueryreplicationshardingstoragestorage.journalwrite
Unless explicitly set, the component has the verbosity level of its parent. For example,
storageis the parent ofstorage.journal. That is, if you specify astorageverbosity level, this level also applies tostorage.journalcomponents unless you specify the verbosity level forstorage.journal.For example, the following sets the
default verbosity levelto1, thequeryto2, thestorageto2, and thestorage.journalto1.You can also set parameter
logComponentVerbosityat startup time, passing the verbosity level document as a string.mongoshell 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¶ Available for both
mongodandmongos.Specify
1to enable logging of userids.Disabled by default.
-
maxLogSizeKB¶ New in version 3.4.
Available for both
mongodandmongos.Type: integer
Default: 10
Specifies the maximum size, in kilobytes, for a log line. Lines exceeding this limit print only the beginning and end of the line, excising the middle portion.
For example, the following sets the maximum size to
20kilobytes:
-
quiet¶ Available for both
mongodandmongos.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
-
redactClientLogData¶ New in version 3.4.
Available for both
mongodandmongos.Type: boolean
Enterprise Feature
Available in MongoDB Enterprise only.
Configure the
mongodormongosto redact any message accompanying a given log event before logging. This prevents the program from writing potentially sensitive data stored on the database to the diagnostic log. Metadata such as error or operation codes, line numbers, and source file names are still visible in the logs.Use
redactClientLogDatain conjunction with Encryption at Rest and Transport Encryption to assist compliance with regulatory requirements.To enable log redaction on a running
mongodormongos, use the following command:See also
-
traceExceptions¶ Available for both
mongodandmongos.Configures
mongodto log full source code stack traces for every database and socket C++ exception, for use with debugging. Iftrue,mongodwill log full stack traces.Consider the following example which sets the
traceExceptionstotrue:See also
-
suppressNoTLSPeerCertificateWarning¶ New in version 3.4.16.
Available for both
mongodandmongos.Type: boolean
Default: false
By default, a
mongodormongoswith TLS/SSL enabled andnet.ssl.allowConnectionsWithoutCertificates:truelets clients connect without providing a certificate for validation while logging an warning. SetsuppressNoTLSPeerCertificateWarningto1ortrueto suppress those warnings.The following operation sets
suppressNoTLSPeerCertificateWarningtotrue:
Diagnostic Parameters¶
Changed in version 3.4.14: MongoDB adds FTDC support for mongos. Previously,
only mongod supported FTDC.
To support the diagnostic data capture, MongoDB introduces the following parameters:
For mongod, the diagnostic data files are stored in the
diagnostic.data directory under the mongod instance’s
--dbpath or storage.dbPath.
For mongos, the diagnostic data files, by default, are
stored in a directory under the mongos instance’s
--logpath or systemLog.path directory. The diagnostic
data directory is computed by truncating the logpath’s file
extension(s) and concatenating diagnostic.data to the remaining
name.
For example, if mongos has --logpath
/var/log/mongos.log.201708015, then the diagnostic data directory is
/var/log/mongos.diagnostic.data/ directory. To specify a different
diagnostic data directory for mongos, set the
diagnosticDataCollectionDirectoryPath parameter.
The following parameters support diagnostic data capture (FTDC):
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.
-
diagnosticDataCollectionEnabled¶ New in version 3.2.
Type: boolean
Default: true
Available for
mongodonly.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:
-
diagnosticDataCollectionDirectoryPath¶ New in version 3.4.14.
Type: String
Available for
mongosonly.Specify the directory for the diagnostic directory for
mongos. If the directory does not exist,mongoscreates the directory.If unspecified, the diagnostic data directory is computed by truncating the
mongosinstance’s--logpathorsystemLog.pathfile extension(s) and concatenatingdiagnostic.data.For example, if
mongoshas--logpath /var/log/mongos.log.201708015, then the diagnostic data directory is/var/log/mongos.diagnostic.data/.Important
If
mongoscannot create the specified directory, e.g. a file exists with the same name in the path or the process does not have permissions to create the directory, the diagnostic data capture will be disabled for that instance.
-
diagnosticDataCollectionDirectorySizeMB¶ New in version 3.2.
Changed in version 3.4: Increased default size to 200 megabytes.
Type: integer
Default: 200
Available for
mongodonly.Specifies the maximum size, in megabytes, of the
diagnostic.datadirectory. 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
250megabytes:The minimum value for
diagnosticDataCollectionDirectorySizeMBis10megabytes.diagnosticDataCollectionDirectorySizeMBmust be greater than maximum diagnostic file sizediagnosticDataCollectionFileSizeMB.
-
diagnosticDataCollectionFileSizeMB¶ New in version 3.2.
Type: integer
Default: 10
Available for
mongodonly.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
20megabytes:The minimum value for
diagnosticDataCollectionFileSizeMBis1megabyte.
-
diagnosticDataCollectionPeriodMillis¶ New in version 3.2.
Type: integer
Default: 1000
Available for
mongodonly.Specifies the interval, in milliseconds, at which to collect diagnostic data.
For example, the following sets the interval to
5000milliseconds or 5 seconds:The minimum value for
diagnosticDataCollectionPeriodMillisis100milliseconds.
Replication Parameters¶
-
replApplyBatchSize¶ Available for
mongodonly.Specify the number of oplog entries to apply as a single batch.
replApplyBatchSizemust 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 amongodstarted with the--slavecommand line option.Batch sizes must be
1for members withslavedelayconfigured.
-
replIndexPrefetch¶ Available for
mongodonly.Use
replIndexPrefetchin conjunction withreplSetNamewhen configuring a replica set. 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.
-
replWriterThreadCount¶ New in version 3.2.
Type: integer
Default: 16
Available for
mongodonly.Number of threads to use to apply replicated operations in parallel. Values can range from 1 to 256 inclusive. You can only set
replWriterThreadCountat startup and cannot change this setting with thesetParametercommand.
Sharding Parameters¶
-
replMonitorMaxFailedChecks¶ Available in MongoDB 3.2 only
Type: integer
Default: 30
The number of times the
mongodormongosinstance 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
mongodormongosinstance 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
mongodormongosinstance 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
mongodormongosinstance should stop its attempt to reach the monitored replica set after unsuccessfully tryingreplMonitorMaxFailedChecksnumber of times.If the monitored replica set is the config server replica set and
timeOutMonitoringReplicaSetsis set totrue, you must restartmongodormongosif themongodormongosinstance 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
mongosonly.Maximum time that
mongosgoes without communication to a host beforemongosdrops all connections to the host.You can only set this parameter during start-up and cannot change this setting using the
setParameterdatabase command.If set,
ShardingTaskExecutorPoolHostTimeoutMSshould be greater than the sum of :parameter`ShardingTaskExecutorPoolRefreshRequirementMS` andShardingTaskExecutorPoolRefreshTimeoutMS. Otherwise, mongos adjusts the value ofShardingTaskExecutorPoolHostTimeoutMSto be greater than the sum.
-
ShardingTaskExecutorPoolMaxConnecting¶ New in version 3.4.6.
Type: integer
Default: 264 - 1
Available for
mongosonly.Maximum number of simultaneous initiating connections (including pending connections in setup/refresh state) each TaskExecutor connection pool can have to a
mongodinstance. You can set this parameter to control the rate at whichmongosadds connections to amongodinstance.If set,
ShardingTaskExecutorPoolMaxConnectingshould be less than or equal toShardingTaskExecutorPoolMaxSize. If it is greater,mongosignores theShardingTaskExecutorPoolMaxConnectingvalue.You can only set this parameter during start-up and cannot change this setting using the
setParameterdatabase command.
-
ShardingTaskExecutorPoolMaxSize¶ Type: integer
Default: 264 - 1
Available for
mongosonly.Maximum number of outbound connections each TaskExecutor connection pool can open to any given
mongodinstance. The maximum possible connections to any given host across all TaskExecutor pools is:You can only set this parameter during start-up and cannot change this setting using the
setParameterdatabase command.mongoscan have up tonTaskExecutor connection pools, wherenis the number of cores. SeetaskExecutorPoolSize.See also
-
ShardingTaskExecutorPoolMinSize¶ Type: integer
Default: 1
Available for
mongosonly.Minimum number of outbound connections each TaskExecutor connection pool can open to any given
mongodinstance.ShardingTaskExecutorPoolMinSizeconnections 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 untilShardingTaskExecutorPoolHostTimeoutMSmilliseconds pass without any application using that pool.You can only set this parameter during start-up and cannot change this setting using the
setParameterdatabase command.mongoscan have up tonTaskExecutor connection pools, wherenis the number of cores. SeetaskExecutorPoolSize.See also
-
ShardingTaskExecutorPoolRefreshRequirementMS¶ Type: integer
Default: 60000 (1 minute)
Available for
mongosonly.Maximum time the
mongoswaits 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
setParameterdatabase command.If set,
ShardingTaskExecutorPoolRefreshRequirementMSshould be greater thanShardingTaskExecutorPoolRefreshTimeoutMS. Otherwise, mongos adjusts the value ofShardingTaskExecutorPoolRefreshTimeoutMSto be less thanShardingTaskExecutorPoolRefreshRequirementMS.
-
ShardingTaskExecutorPoolRefreshTimeoutMS¶ Type: integer
Default: 20000 (20 seconds)
Available for
mongosonly.Maximum time the
mongoswaits for a heartbeat before timing out the heartbeat.You can only set this parameter during start-up and cannot change this setting using the
setParameterdatabase command.If set,
ShardingTaskExecutorPoolRefreshTimeoutMSshould be less thanShardingTaskExecutorPoolRefreshRequirementMS. Otherwise, mongos adjusts the value ofShardingTaskExecutorPoolRefreshTimeoutMSto be less thanShardingTaskExecutorPoolRefreshRequirementMS.
-
taskExecutorPoolSize¶ Type: integer
Default: Number of cores
Available for
mongosonly.The number of Task Executor connection pools to use for a given
mongos. The parameter has a minimum value of4and a maximum value of64.You can only set this parameter during start-up and cannot change this setting using the
setParameterdatabase command.
-
migrateCloneInsertionBatchDelayMS¶ New in version 3.4.18.
Available for
mongodonly.Type: Non-negative integer
Default: 0
Time in milliseconds to wait between batches of insertions during cloning step of the migration process. This wait is in addition to the
secondaryThrottle.The default value of
0indicates no additional wait.The following sets the
migrateCloneInsertionBatchDelayMSto 200 milliseconds:The parameter may also be set using the
setParametercommand:
-
migrateCloneInsertionBatchSize¶ New in version 3.4.18.
Available for
mongodonly.Type: Non-negative integer
Default: 0
The maximum number of documents to insert in a single batch during the cloning step of the migration process.
The default value of
0indicates no maximum number of documents per batch. However, in practice, this results in batches that contain up to 16 MB of documents.The following sets the
migrateCloneInsertionBatchSizeto 100 documents:The parameter may also be set using the
setParametercommand:
-
rangeDeleterBatchDelayMS¶ New in version 3.4.17.
Available for
mongodonly.Type: Non-negative integer
Default: 20
The amount of time in milliseconds to wait before the next batch of deletion during the cleanup stage of chunk migration (or the
cleanupOrphanedcommand).In MongoDB 3.4, consider whether _secondaryThrottle is set before modifying the
rangeDeleterBatchDelayMS. In MongoDB 3.4, the _secondaryThrottle replication delay occurs after each document deletion instead of after the batch deletion.The following sets the
rangeDeleterBatchDelayMSto 200 milliseconds:The parameter may also be set using the
setParametercommand:
-
rangeDeleterBatchSize¶ New in version 3.4.19.
Available for
mongodonly.Type: Non-negative integer
Default: 0
The maximum number of documents in each batch to delete during the cleanup stage of chunk migration (or the
cleanupOrphanedcommand).The default value of
0indicates that the system chooses an appropriate value, generally 128 documents.The following sets the
rangeDeleterBatchSizeto 100 documents:The parameter may also be set using the
setParametercommand:
-
skipShardingConfigurationChecks¶ New in version 3.4.11.
Available for
mongodonly.Type: boolean
Default: false
When
true, allows for starting a shard member or config server replica set member as a standalone for maintenance operations. This parameter is mutually exclusive with the--configsvror--shardsvroptions.You can only set this parameter during start-up and cannot change this setting using the
setParameterdatabase command.Important
Once maintenance has completed, remove the
skipShardingConfigurationChecksparameter when restarting themongod.
Storage Parameters¶
-
journalCommitInterval¶ Available for
mongodonly.Specify an integer between
1and500signifying the number of milliseconds (ms) between journal commits.Consider the following example which sets the
journalCommitIntervalto200ms:See also
-
syncdelay¶ Available for
mongodonly.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:
WiredTiger Parameters¶
-
wiredTigerConcurrentReadTransactions¶ New in version 3.0.0.
Available for
mongodonly.Available for the WiredTiger storage engine only.
Specify the maximum number of concurrent read transactions allowed into the WiredTiger storage engine.
See also
-
wiredTigerConcurrentWriteTransactions¶ New in version 3.0.0.
Available for
mongodonly.Available for the WiredTiger storage engine only.
Specify the maximum number of concurrent write transactions allowed into the WiredTiger storage engine.
See also
-
wiredTigerEngineRuntimeConfig¶ New in version 3.0.0.
Available for
mongodonly.Specify
wiredTigerstorage engine configuration options for a runningmongodinstance. You can only set this parameter using thesetParametercommand and not using the command line or configuration file option.Warning
Avoid modifying the
wiredTigerEngineRuntimeConfigunless under the direction from MongoDB engineers as this setting has major implication across both WiredTiger and MongoDB.Consider the following operation prototype:
See the WiredTiger documentation for all available WiredTiger configuration options.
Auditing Parameters¶
-
auditAuthorizationSuccess¶ New in version 2.6.5.
Default:
falseNote
Available only in MongoDB Enterprise.
Available for both
mongodandmongos.Enables the auditing of authorization successes for the authCheck action.
When
auditAuthorizationSuccessisfalse, the audit system only logs the authorization failures forauthCheck.To enable the audit of authorization successes, issue the following command:
Enabling
auditAuthorizationSuccessdegrades performance more than logging only the authorization failures.
See also