0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/debian/mongodb-parameters.5
2020-10-15 13:55:19 +00:00

4816 lines
114 KiB
Groff

.\" Man page generated from reStructuredText.
.
.TH "MONGODB-PARAMETERS" "5" "Jun 23, 2020" "4.4" "mongodb-manual"
.SH NAME
mongodb-parameters \- MongoDB setParameter Options
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SS On this page
.INDENT 0.0
.IP \(bu 2
\fI\%Synopsis\fP
.IP \(bu 2
\fI\%Parameters\fP
.INDENT 2.0
.IP \(bu 2
\fI\%Authentication Parameters\fP
.IP \(bu 2
\fI\%General Parameters\fP
.IP \(bu 2
\fI\%Logging Parameters\fP
.IP \(bu 2
\fI\%Diagnostic Parameters\fP
.IP \(bu 2
\fI\%Logical Session Parameters\fP
.IP \(bu 2
\fI\%Replication Parameters\fP
.IP \(bu 2
\fI\%Sharding Parameters\fP
.IP \(bu 2
\fI\%Storage Parameters\fP
.IP \(bu 2
\fI\%WiredTiger Parameters\fP
.IP \(bu 2
\fI\%Auditing Parameters\fP
.IP \(bu 2
\fI\%Transaction Parameters\fP
.UNINDENT
.UNINDENT
.SH SYNOPSIS
.sp
MongoDB provides a number of configuration options that you can set
using:
.INDENT 0.0
.IP \(bu 2
the \fBsetParameter\fP command:
.INDENT 2.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, <parameter>: <value> } )
.ft P
.fi
.UNINDENT
.UNINDENT
.IP \(bu 2
the \fBsetParameter\fP configuration setting:
.INDENT 2.0
.INDENT 3.5
.sp
.nf
.ft C
setParameter:
<parameter1>: <value1>
...
.ft P
.fi
.UNINDENT
.UNINDENT
.IP \(bu 2
the \fB\-\-setParameter\fP command\-line option for \fBmongod\fP
and \fBmongos\fP:
.INDENT 2.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter <parameter>=<value>
mongos \-\-setParameter <parameter>=<value>
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.sp
For additional configuration options, see
/reference/configuration\-options, \fBmongod\fP and
\fBmongos\fP\&.
.SH PARAMETERS
.SS Authentication Parameters
.INDENT 0.0
.TP
.B authenticationMechanisms
Changed in version 4.0: Remove support for the deprecated \fBMONGODB\-CR\fP authentication mechanism.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
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 /core/authentication\&.
.TS
center;
|l|l|.
_
T{
Value
T} T{
Description
T}
_
T{
SCRAM\-SHA\-1
T} T{
\fI\%RFC 5802\fP standard
Salted Challenge Response Authentication Mechanism using the SHA\-1
hash function.
T}
_
T{
SCRAM\-SHA\-256
T} T{
\fI\%RFC 7677\fP standard
Salted Challenge Response Authentication Mechanism using the SHA\-256
hash function.
.sp
Requires featureCompatibilityVersion set to \fB4.0\fP\&.
.sp
New in version 4.0.
T}
_
T{
MONGODB\-X509
T} T{
MongoDB TLS/SSL certificate authentication.
T}
_
T{
GSSAPI (Kerberos)
T} T{
External authentication using Kerberos. This mechanism is
available only in \fI\%MongoDB Enterprise\fP\&.
T}
_
T{
PLAIN (LDAP SASL)
T} T{
External authentication using LDAP. You can also use \fBPLAIN\fP
for authenticating in\-database users. \fBPLAIN\fP transmits
passwords in plain text. This mechanism is available only in
\fI\%MongoDB Enterprise\fP\&.
T}
_
.TE
.sp
You can only set \fI\%authenticationMechanisms\fP during
start\-up.
.sp
For example, to specify both \fBPLAIN\fP and \fBSCRAM\-SHA\-256\fP as the
authentication mechanisms, use the following command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter authenticationMechanisms=PLAIN,SCRAM\-SHA\-256 \-\-auth
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B clusterAuthMode
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Set the \fBclusterAuthMode\fP to either \fBsendX509\fP or
\fBx509\fP\&. Useful during rolling upgrade to use x509 for
membership authentication
to minimize downtime.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, clusterAuthMode: "sendX509" } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B enableLocalhostAuthBypass
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Specify \fB0\fP or \fBfalse\fP to disable localhost authentication
bypass. Enabled by default.
.sp
\fI\%enableLocalhostAuthBypass\fP is not available using
\fBsetParameter\fP database command. Use the
\fBsetParameter\fP option in the configuration file or the
\fB\-\-setParameter\fP option on the
command line.
.sp
See localhost\-exception for more information.
.UNINDENT
.INDENT 0.0
.TP
.B KeysRotationIntervalSec
New in version 3.6.
.sp
\fIDefault\fP: 7776000 seconds (90 days)
.sp
Specifies the number of seconds for which an \fI\%HMAC signing key\fP
is valid before rotating to the next one. This parameter is intended
primarily to facilitate authentication testing.
.sp
You can only set \fI\%KeysRotationIntervalSec\fP during
start\-up, and cannot change this setting with the
\fBsetParameter\fP database command.
.UNINDENT
.INDENT 0.0
.TP
.B ldapUserCacheInvalidationInterval
For use with MongoDB deployments using
security\-ldap\-external\&. Available for \fBmongod\fP
instances only.
.sp
The interval (in seconds) that the \fBmongod\fP instance
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.
.sp
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.
.sp
Defaults to 30 seconds.
.UNINDENT
.INDENT 0.0
.TP
.B ldapUseConnectionPool
New in version 4.0.9.
.sp
Specifies whether MongoDB should use connection pooling when
connecting to the LDAP server for authentication/authorization.
.sp
\fBStarting in version 4.2\fP, MongoDB uses the following default values:
.INDENT 7.0
.IP \(bu 2
true on Windows.
.IP \(bu 2
true on Linux where MongoDB Enterprise binaries are linked against
\fBlibldap_r\fP\&.
.IP \(bu 2
false on Linux where MongoDB Enterprise binaries are linked against
\fBlibldap\fP\&.
.UNINDENT
.sp
\fBIn earlier versions (versions 4.0.9+)\fP, the default value is
\fBfalse\fP\&.
.sp
You can only set \fI\%ldapUseConnectionPool\fP during
start\-up, and cannot change this setting with the
\fBsetParameter\fP database command.
.UNINDENT
.INDENT 0.0
.TP
.B ldapConnectionPoolUseLatencyForHostPriority
\fINew in version 4.2.1 and 4.0.13\fP
.sp
\fIDefault\fP: true
.sp
A boolean that determines whether the LDAP connection pool (see
\fI\%ldapUseConnectionPool\fP) should use latency of the LDAP
servers to determine the connection order (from lowest latency to
highest).
.sp
You can only set
\fI\%ldapConnectionPoolUseLatencyForHostPriority\fP during
start\-up, and cannot change this setting during runtime with the
\fBsetParameter\fP database command.
.UNINDENT
.INDENT 0.0
.TP
.B ldapConnectionPoolMinimumConnectionsPerHost
\fINew in version 4.2.1 and 4.0.13\fP
.sp
\fIDefault\fP: 1
.sp
The minimum number of connections to keep open to each LDAP server.
.sp
You can only set
\fI\%ldapConnectionPoolMinimumConnectionsPerHost\fP during
start\-up, and cannot change this setting during runtime with the
\fBsetParameter\fP database command.
.UNINDENT
.INDENT 0.0
.TP
.B ldapConnectionPoolMaximumConnectionsPerHost
\fINew in version 4.2.1 and 4.0.13\fP
.sp
\fIChanged in version 4.4\fP Changed default value to \fB2\fP\&. In previous
versions, the default is unset.
.sp
\fIDefault\fP: 2
.sp
The maximum number of connections to keep open to each LDAP server.
.sp
You can only set
\fI\%ldapConnectionPoolMaximumConnectionsPerHost\fP during
start\-up, and cannot change this setting during runtime with the
\fBsetParameter\fP database command.
.UNINDENT
.INDENT 0.0
.TP
.B ldapConnectionPoolMaximumConnectionsInProgressPerHost
\fINew in version 4.2.1 and 4.0.13\fP
.sp
The maximum number of in\-progress connect operations to each LDAP server.
.sp
You can only set
\fI\%ldapConnectionPoolMaximumConnectionsInProgressPerHost\fP
during start\-up, and cannot change this setting with the
\fBsetParameter\fP database command.
.UNINDENT
.INDENT 0.0
.TP
.B ldapConnectionPoolHostRefreshIntervalMillis
\fINew in version 4.2.1 and 4.0.13\fP
.sp
\fIDefault\fP: 60000
.sp
The number of milliseconds in\-between health checks of the pooled
LDAP connections.
.sp
You can only set
\fI\%ldapConnectionPoolHostRefreshIntervalMillis\fP during
start\-up, and cannot change this setting with the
\fBsetParameter\fP database command.
.UNINDENT
.INDENT 0.0
.TP
.B ldapConnectionPoolIdleHostTimeoutSecs
\fINew in version 4.2.1 and 4.0.13\fP
.sp
\fIDefault\fP: 300
.sp
The maximum number of seconds that the pooled connections to an LDAP
server can remain idle before being closed.
.sp
You can only set
\fI\%ldapConnectionPoolIdleHostTimeoutSecs\fP during
start\-up, and cannot change this setting with the
\fBsetParameter\fP database command.
.UNINDENT
.INDENT 0.0
.TP
.B ocspEnabled
New in version 4.4: Available on Linux and macOS.
.sp
\fIDefault\fP: true
.sp
The flag that enables or disables OCSP.
.sp
You can only set \fI\%ocspEnabled\fP during startup in the
\fBconfiguration file\fP or with the
\fB\-\-setParameter\fP option on the command line. For example, the
following disables OCSP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter ocspEnabled=false ...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%ocspValidationRefreshPeriodSecs\fP
.IP \(bu 2
\fI\%tlsOCSPStaplingTimeoutSecs\fP
.IP \(bu 2
\fI\%tlsOCSPVerifyTimeoutSecs\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B ocspValidationRefreshPeriodSecs
New in version 4.4: Available on Linux.
.sp
The number of seconds to wait before refreshing the stapled OCSP
status response. Specify a number greater than or equal to 1.
.sp
You can only set \fI\%ocspValidationRefreshPeriodSecs\fP during
startup in the \fBconfiguration file\fP or with
the \fB\-\-setParameter\fP option on the command line. For example, the
following sets the parameter to 3600 seconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter ocspValidationRefreshPeriodSecs=3600 ...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%ocspEnabled\fP
.IP \(bu 2
\fI\%tlsOCSPStaplingTimeoutSecs\fP
.IP \(bu 2
\fI\%tlsOCSPVerifyTimeoutSecs\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B opensslCipherConfig
New in version 3.6.
.sp
Changed in version 4.0: With the use of native TLS/SSL libraries, the parameter
\fI\%opensslCipherConfig\fP is supported for Linux/BSD and
no longer supported in Windows and macOS. See MongoDB 4.0
TLS/SSL\&.
.sp
Specify the cipher string for OpenSSL when using TLS/SSL encryption.
For a list of cipher strings, see
\fI\%https://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER\-STRINGS\fP
.sp
You can only set \fI\%opensslCipherConfig\fP during start\-up, and
cannot change this setting using the \fBsetParameter\fP
database command.
.sp
For version 4.2 and greater, the use of \fBTLS\fP options is preferred
over \fBSSL\fP options. The TLS options have the same functionality as
the \fBSSL\fP options.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter opensslCipherConfig=\(aqHIGH:!EXPORT:!aNULL@STRENGTH\(aq \-\-tlsMode requireTLS \-\-tlsCertificateKeyFile Certs/server.pem
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For versions 4.0 and earlier:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter opensslCipherConfig=\(aqHIGH:!EXPORT:!aNULL@STRENGTH\(aq \-\-sslMode requireSSL \-\-sslPEMKeyFile Certs/server.pem
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B opensslDiffieHellmanParameters
New in version 3.6.
.sp
\fIAvailable on Linux only\fP
.sp
Specify the path to the PEM file that contains the OpenSSL
Diffie\-Hellman parameters. Specifying the OpenSSL Diffie\-Hellman
parameters enables support for dhe cipher suites during
TLS/SSL encryption.
.sp
Ephemeral Diffie\-Hellman (DHE) cipher suites (and Ephemeral Elliptic
Curve Diffie\-Hellman (ECDHE) cipher suites) provide
tls\-forward\-secrecy\&. tls\-forward\-secrecy cipher suites
create an ephemeral session key that is protected by the server\(aqs
private key but never transmitted. This ensures that even if a
server\(aqs private key is compromised, you cannot decrypt past
sessions with the compromised key.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Starting in MongoDB 4.2, if
\fI\%opensslDiffieHellmanParameters\fP is unset but
ECDHE is enabled, MongoDB enables DHE using
\fBffdhe3072\fP Diffie\-Hellman parameter, as defined in
\fI\%RFC 7919#appendix\-A.2\fP\&. The \fBffdhe3072\fP is a strong parameter
(i.e. size is greater than 1024). Strong parameters are not
supported with Java 6 and 7 unless extended support has been
purchased from Oracle.
.UNINDENT
.UNINDENT
.sp
You can only set \fI\%opensslDiffieHellmanParameters\fP during
startup, and cannot change this setting using the
\fBsetParameter\fP database command.
.sp
If for performance reasons, you need to disable support for DHE
cipher suites, use the \fI\%opensslCipherConfig\fP parameter:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter opensslCipherConfig=\(aqHIGH:!EXPORT:!aNULL:!DHE:!kDHE@STRENGTH\(aq ...
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B saslauthdPath
.
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Available only in MongoDB Enterprise (except MongoDB Enterprise for Windows).
.UNINDENT
.UNINDENT
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Specify the path to the Unix Domain Socket of the \fBsaslauthd\fP
instance to use for proxy authentication.
.UNINDENT
.INDENT 0.0
.TP
.B saslHostName
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fI\%saslHostName\fP overrides MongoDB\(aqs default hostname
detection for the purpose of configuring SASL and Kerberos
authentication.
.sp
\fI\%saslHostName\fP does not affect the hostname of the
\fBmongod\fP or \fBmongos\fP instance for any purpose
beyond the configuration of SASL and Kerberos.
.sp
You can only set \fI\%saslHostName\fP during start\-up, and
cannot change this setting using the \fBsetParameter\fP
database command.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%saslHostName\fP supports Kerberos authentication and is
only included in MongoDB Enterprise. For more information, see the
following:
.INDENT 0.0
.IP \(bu 2
Linux:
/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
.IP \(bu 2
Windows:
/tutorial/control\-access\-to\-mongodb\-windows\-with\-kerberos\-authentication
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B saslServiceName
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
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 \fBmongodb\fP\&.
.sp
MongoDB only permits setting \fI\%saslServiceName\fP at
startup. The \fBsetParameter\fP command can not change
this setting.
.sp
\fI\%saslServiceName\fP is only available in MongoDB
Enterprise.
.sp
\fBIMPORTANT:\fP
.INDENT 7.0
.INDENT 3.5
Ensure that your driver supports alternate service names.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B scramIterationCount
\fIDefault\fP: \fB10000\fP
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Changes the number of hashing iterations used for all new
\fBSCRAM\-SHA\-1\fP 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.
.sp
If you modify this value, it does not change the iteration count for
existing passwords. The \fI\%scramIterationCount\fP value must
be \fB5000\fP or greater.
.sp
For example, the following sets the \fI\%scramIterationCount\fP
to \fB12000\fP\&.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter scramIterationCount=12000
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or, if using the \fBsetParameter\fP command within the
\fBmongo\fP shell:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, scramIterationCount: 12000 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fBdb.changeUserPassword()\fP
.IP \(bu 2
\fBdb.createUser()\fP
.IP \(bu 2
\fBdb.updateUser()\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B scramSHA256IterationCount
New in version 4.0.
.sp
\fIDefault\fP: \fB15000\fP
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Changes the number of hashing iterations used for all new
\fBSCRAM\-SHA\-256\fP 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.
.sp
If you modify this value, it does not change iteration count for
existing passwords. The \fI\%scramSHA256IterationCount\fP value
must be \fB5000\fP or greater.
.sp
For example, the following sets the \fI\%scramSHA256IterationCount\fP
to \fB20000\fP\&.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter scramSHA256IterationCount=20000
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or, if using the \fBsetParameter\fP command within the
\fBmongo\fP shell:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, scramSHA256IterationCount: 20000 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fBdb.changeUserPassword()\fP
.IP \(bu 2
\fBdb.createUser()\fP
.IP \(bu 2
\fBdb.updateUser()\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B sslMode
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Set the \fBnet.ssl.mode\fP to either \fBpreferSSL\fP or
\fBrequireSSL\fP\&. Useful during rolling upgrade to TLS/SSL to minimize downtime.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, sslMode: "preferSSL" } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%tlsMode\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B tlsMode
New in version 4.2.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Set to either:
.INDENT 7.0
.IP \(bu 2
\fBpreferTLS\fP
.IP \(bu 2
\fBrequireTLS\fP
.UNINDENT
.sp
The \fI\%tlsMode\fP parameter is useful during rolling
upgrade to TLS/SSL to minimize
downtime.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, tlsMode: "preferTLS" } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%sslMode\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B tlsOCSPStaplingTimeoutSecs
New in version 4.4: Available for Linux.
.sp
The maximum number of seconds the
\fBmongod\fP/\fBmongos\fP instance should wait to
receive the OCSP status response for its certificates.
.sp
Specify an integer greater than or equal to (\fB>=\fP) 1. If unset,
\fI\%tlsOCSPStaplingTimeoutSecs\fP uses the
\fI\%tlsOCSPVerifyTimeoutSecs\fP value.
.sp
You can only set \fI\%tlsOCSPStaplingTimeoutSecs\fP during
startup in the \fBconfiguration file\fP or with
the \fB\-\-setParameter\fP option on the command line. For example, the
following sets the \fI\%tlsOCSPStaplingTimeoutSecs\fP to 20
seconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter tlsOCSPStaplingTimeoutSecs=20 ...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%ocspEnabled\fP
.IP \(bu 2
\fI\%ocspValidationRefreshPeriodSecs\fP
.IP \(bu 2
\fI\%tlsOCSPVerifyTimeoutSecs\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B tlsOCSPVerifyTimeoutSecs
New in version 4.4: Available for Linux and Windows.
.sp
\fIDefault\fP: 5
.sp
The maximum number of seconds that the
\fBmongod\fP/\fBmongos\fP should wait for the OCSP
response when verifying client certificates.
.sp
Specify an integer greater than or equal to (\fB>=\fP) 1. Default is
unlimited.
.sp
You can only set \fI\%tlsOCSPVerifyTimeoutSecs\fP during
startup in the \fBconfiguration file\fP or with
the \fB\-\-setParameter\fP option on the command line. For example, the
following sets the \fI\%tlsOCSPVerifyTimeoutSecs\fP to 20
seconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter tlsOCSPVerifyTimeoutSecs=20 ...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%ocspEnabled\fP
.IP \(bu 2
\fI\%ocspValidationRefreshPeriodSecs\fP
.IP \(bu 2
\fI\%tlsOCSPStaplingTimeoutSecs\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B tlsWithholdClientCertificate
\fIDefault\fP: false
.sp
New in version 4.2.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
A TLS certificate is set for a \fBmongod\fP or
\fBmongos\fP either by the
\fB\-\-tlsClusterFile\fP option or by the
\fB\-\-tlsCertificateKeyFile\fP option when
\fB\-\-tlsClusterFile\fP is not set. If the TLS
certificate is set, by default, the instance sends the certificate when
initiating intra\-cluster communications with other
\fBmongod\fP or \fBmongos\fP instances in
the deployment. Set \fBtlsWithholdClientCertificate\fP to \fB1\fP or \fBtrue\fP to
direct the instance to withhold sending its TLS certificate during these
communications. Use this option with
\fB\-\-tlsAllowConnectionsWithoutCertificates\fP
(to allow inbound connections without certificates) on all members of the
deployment. \fBtlsWithholdClientCertificate\fP is mutually exclusive with
\fB\-\-clusterAuthMode x509\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B tlsX509ClusterAuthDNOverride
New in version 4.2.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
An alternative Distinguished Name (DN) that the instance can also
use to identify members of the deployment.
.sp
For a MongoDB deployment that uses x.509 certificates for
\fBclusterAuthMode\fP, deployment members identify
each other using x.509 certificates (
\fBnet.tls.clusterFile\fP, if specified, and
\fBnet.tls.certificateKeyFile\fP) during intra\-cluster
communications. For members of the same deployment, the \fBDN\fP from
their certificates must have the same Organization attributes
(\fBO\fP\(aqs), the Organizational Unit attributes (\fBOU\fP\(aqs), and the
Domain Components (\fBDC\fP\(aqs).
.sp
If \fI\%tlsX509ClusterAuthDNOverride\fP is set for a member,
the member can also use the override value when comparing the \fBDN\fP
components (\fBO\fP\(aqs, \fBOU\fP\(aqs, and \fBDC\fP\(aqs) of the presented
certificates. That is the member checks the presented certificates
against its
\fBnet.tls.clusterFile\fP/\fBnet.tls.certificateKeyFile\fP\&.
If the DN does not match, the member checks the presented
certificate against the \fI\%tlsX509ClusterAuthDNOverride\fP
value.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
If set, you must set this parameter on all members of the
deployment.
.UNINDENT
.UNINDENT
.sp
You can use this parameter for a rolling update of certificates to
new certificates that contain a new \fBDN\fP value. See
/tutorial/rotate\-x509\-membership\-certificates\&.
.sp
For more information about membership certificate requirements, see
x509\-member\-certificate\-requirements for details.
.UNINDENT
.INDENT 0.0
.TP
.B tlsX509ExpirationWarningThresholdDays
New in version 4.4.
.sp
\fIDefault\fP : 30
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Starting in MongoDB 4.4, \fBmongod\fP/\fBmongos\fP
logs a warning on connection if the presented x.509 certificate
expires within \fB30\fP days of the \fBmongod/mongos\fP system clock.
Use the \fI\%tlsX509ExpirationWarningThresholdDays\fP parameter
to control the certificate expiration warning threshold:
.INDENT 7.0
.IP \(bu 2
Increase the parameter value to trigger warnings farther ahead of
the certificate expiration date.
.IP \(bu 2
Decrease the parameter value to trigger warnings closer to the
certificate expiration date.
.IP \(bu 2
Set the parameter to \fB0\fP to disable the warning.
.UNINDENT
.sp
This parameter has a minimum value of \fB0\fP\&.
.sp
You can only set \fI\%tlsX509ExpirationWarningThresholdDays\fP
during \fBmongod/mongos\fP startup using either:
.INDENT 7.0
.IP \(bu 2
The \fBsetParameter\fP configuration setting, \fIor\fP
.IP \(bu 2
The \fBmongod \-\-setParameter\fP /
\fBmongos \-\-setParameter\fP command
line option.
.UNINDENT
.sp
See 4.4\-rel\-notes\-certificate\-expiration\-warning for more
information on x.509 expiration warnings in MongoDB 4.4.
.sp
For more information on x.509 certificate validity, see \fI\%RFC 5280
4.1.2.5\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B sslWithholdClientCertificate
\fIDefault\fP: false
.sp
Deprecated since version 4.2: Use \fI\%tlsWithholdClientCertificate\fP instead.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
A TLS certificate is set for a \fBmongod\fP or
\fBmongos\fP either by the
\fB\-\-tlsClusterFile\fP option or by the
\fB\-\-tlsCertificateKeyFile\fP option when
\fB\-\-tlsClusterFile\fP is not set. If the TLS
certificate is set, by default, the instance sends the certificate when
initiating intra\-cluster communications with other
\fBmongod\fP or \fBmongos\fP instances in
the deployment. Set \fBsslWithholdClientCertificate\fP to \fB1\fP or \fBtrue\fP to
direct the instance to withhold sending its TLS certificate during these
communications. Use this option with
\fB\-\-tlsAllowConnectionsWithoutCertificates\fP
(to allow inbound connections without certificates) on all members of the
deployment. \fBsslWithholdClientCertificate\fP is mutually exclusive with
\fB\-\-clusterAuthMode x509\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B userCacheInvalidationIntervalSecs
\fIDefault\fP: 30
.sp
Available for \fBmongos\fP only.
.sp
On a \fBmongos\fP instance, specifies the interval (in seconds)
at which the \fBmongos\fP 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,
\fBmongos\fP will not clear the cache.
.sp
This parameter has a minimum value of \fB1\fP second and a maximum
value of \fB86400\fP seconds (24 hours).
.UNINDENT
.INDENT 0.0
.TP
.B authFailedDelayMs
\fIDefault\fP: 0
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
New in version 3.4.
.INDENT 7.0
.INDENT 3.5
.IP "Enterprise Feature"
.sp
Available in MongoDB Enterprise only.
.UNINDENT
.UNINDENT
.sp
The number of milliseconds to wait before informing clients that their
authentication attempt has failed. This parameter may be in the range
\fB0\fP to \fB5000\fP, inclusive.
.sp
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.
.UNINDENT
.INDENT 0.0
.TP
.B allowRolesFromX509Certificates
\fIDefault\fP: true
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIAvailable starting in MongoDB 4.0.11 (and 3.6.14 and 3.4.22)\fP
.sp
A boolean flag that allows or disallows the retrieval of
authorization roles from client x.509 certificates.
.sp
You can only set \fI\%allowRolesFromX509Certificates\fP during
startup in the config file or on the command line.
.UNINDENT
.SS General Parameters
.INDENT 0.0
.TP
.B connPoolMaxShardedConnsPerHost
\fIDefault\fP: 200
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Sets the maximum size of the legacy connection pools for communication to the
shards. The size of a pool does not prevent the creation of
additional connections, but \fIdoes\fP prevent the connection pools from
retaining connections above this limit.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
The parameter is separate from the connections in TaskExecutor
pools. See \fI\%ShardingTaskExecutorPoolMaxSize\fP\&.
.UNINDENT
.UNINDENT
.sp
Increase the \fI\%connPoolMaxShardedConnsPerHost\fP value
\fBonly\fP if the number of connections in a connection pool has a
high level of churn or if the total number of created connections
increase.
.sp
You can only set \fI\%connPoolMaxShardedConnsPerHost\fP during
startup in the config file or on the command line. For example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter connPoolMaxShardedConnsPerHost=250
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B connPoolMaxShardedInUseConnsPerHost
New in version 3.6.3.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Sets the maximum number of in\-use connections at any given time for
the legacy sharded cluster connection pools.
.sp
By default, the parameter is unset.
.sp
You can only set \fI\%connPoolMaxShardedConnsPerHost\fP during
startup in the config file or on the command line. For example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter connPoolMaxShardedInUseConnsPerHost=100
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%connPoolMaxShardedConnsPerHost\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B shardedConnPoolIdleTimeoutMinutes
New in version 3.6.3.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Sets the time limit that a connection in the legacy sharded cluster
connection pool can remain idle before being closed.
.sp
By default, the parameter is unset.
.sp
You can only set \fI\%shardedConnPoolIdleTimeoutMinutes\fP during
startup in the config file or on the command line. For example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter shardedConnPoolIdleTimeoutMinutes=10
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%connPoolMaxShardedConnsPerHost\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B connPoolMaxConnsPerHost
\fIDefault\fP: 200
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Sets the maximum size of the legacy connection pools for outgoing connections
to other \fBmongod\fP instances in the global connection pool. The size
of a pool does not prevent the creation of additional connections,
but \fIdoes\fP prevent a connection pool from retaining connections in
excess of the value of \fI\%connPoolMaxConnsPerHost\fP\&.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
The parameter is separate from the connections in TaskExecutor
pools. See \fI\%ShardingTaskExecutorPoolMaxSize\fP\&.
.UNINDENT
.UNINDENT
.sp
\fBOnly\fP adjust this setting if your driver does \fInot\fP pool
connections and you\(aqre using authentication in the
context of a sharded cluster.
.sp
You can only set \fI\%connPoolMaxConnsPerHost\fP during startup
in the config file or on the command line. For example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter connPoolMaxConnsPerHost=250
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B connPoolMaxInUseConnsPerHost
New in version 3.6.3.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Sets the maximum number of in\-use connections at any given time for
for outgoing connections to other \fBmongod\fP instances in
the legacy global connection pool.
.sp
By default, the parameter is unset.
.sp
You can only set \fI\%connPoolMaxInUseConnsPerHost\fP during
startup in the config file or on the command line. For example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter connPoolMaxInUseConnsPerHost=100
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%connPoolMaxConnsPerHost\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B globalConnPoolIdleTimeoutMinutes
New in version 3.6.3.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Sets the time limit that connection in the legacy global connection
pool can remain idle before being closed.
.sp
By default, the parameter is unset.
.sp
You can only set \fI\%globalConnPoolIdleTimeoutMinutes\fP
during startup in the config file or on the command line. For
example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter globalConnPoolIdleTimeoutMinutes=10
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%connPoolMaxShardedConnsPerHost\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B cursorTimeoutMillis
\fIDefault\fP: 600000 (i.e. 10 minutes)
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
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 \fI\%cursorTimeoutMillis\fP\&.
.sp
For example, the following sets the \fI\%cursorTimeoutMillis\fP
to \fB300000\fP milliseconds (i.e. 5 minutes).
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter cursorTimeoutMillis=300000
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or, if using the \fBsetParameter\fP command within the
\fBmongo\fP shell:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, cursorTimeoutMillis: 300000 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Setting \fI\%cursorTimeoutMillis\fP to less than or equal
to \fB0\fP results 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 the \fBcursor.explain()\fP
cursor modifier to analyze the average query time and select an appropriate
timeout period.
.UNINDENT
.INDENT 0.0
.TP
.B failIndexKeyTooLong
\fIRemoved in 4.4\fP
.sp
\fBIMPORTANT:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fBMongoDB 4.4\fP \fIremoves\fP the deprecated
\fI\%failIndexKeyTooLong\fP parameter. Attempting to use
this parameter with MongoDB 4.4 will result in an error.
.IP \(bu 2
\fBMongoDB 4.2\fP \fIdeprecates\fP the
\fI\%failIndexKeyTooLong\fP parameter and \fIremoves\fP the
\fBIndex Key Length Limit\fP for
featureCompatibilityVersion (fCV) set to
\fB"4.2"\fP or greater.
.UNINDENT
.UNINDENT
.UNINDENT
.sp
For MongoDB 2.6 through MongoDB versions with
featureCompatibilityVersion (fCV) set to \fB"4.0"\fP or earlier,
\fBIndex Key Length Limit\fP applies. If you
attempt to insert or update a document whose index field exceeds
the \fBIndex Key Length Limit\fP, the operation
will fail and return an error to the client.
.sp
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 \fI\%failIndexKeyTooLong\fP to disable this behavior.
.sp
Setting \fI\%failIndexKeyTooLong\fP to \fBfalse\fP is
a temporary workaround, not a permanent solution to the
problem of oversized index keys. With
\fI\%failIndexKeyTooLong\fP set to \fBfalse\fP, queries can
return incomplete results if they use indexes that skip over
documents whose indexed fields exceed the
\fBIndex Key Length Limit\fP\&.
.sp
\fI\%failIndexKeyTooLong\fP defaults to \fBtrue\fP\&.
.sp
Issue the following command to disable the index key length
validation:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, failIndexKeyTooLong: false } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can also set \fI\%failIndexKeyTooLong\fP at
startup time with the following option:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter failIndexKeyTooLong=false
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B notablescan
Available for \fBmongod\fP only.
.sp
Specify whether \fBall\fP queries must use indexes. If \fB1\fP, MongoDB
will not execute queries that require a collection scan and will return an
error.
.sp
Consider the following example which sets \fI\%notablescan\fP to \fB1\fP
or true:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, notablescan: 1 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Setting \fI\%notablescan\fP to \fB1\fP can be useful for testing
application queries, for example, to identify queries that scan an
entire collection and cannot use an index.
.sp
To detect unindexed queries without \fBnotablescan\fP, consider reading
the /tutorial/evaluate\-operation\-performance and
/tutorial/optimize\-query\-performance\-with\-indexes\-and\-projections
sections and using the \fI\%logLevel\fP parameter,
/reference/program/mongostat and profiling\&.
.sp
Don\(aqt run production \fBmongod\fP instances with
\fI\%notablescan\fP because preventing collection scans can potentially
affect queries in all databases, including administrative queries.
.UNINDENT
.INDENT 0.0
.TP
.B ttlMonitorEnabled
Available for \fBmongod\fP only.
.sp
To support TTL Indexes, \fBmongod\fP
instances have a background thread that is responsible for deleting
documents from collections with TTL indexes.
.sp
To disable this worker thread for a \fBmongod\fP, set
\fI\%ttlMonitorEnabled\fP to \fBfalse\fP, as in the following
operations:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, ttlMonitorEnabled: false } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Alternately, you may disable the thread at startup time by starting the
\fBmongod\fP instance with the following option:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter ttlMonitorEnabled=false
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B tcpFastOpenServer
New in version 4.4.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIDefault\fP: \fBtrue\fP
.sp
Enables support for accepting inbound TCP Fast Open (TFO) connections
to the \fBmongod/mongos\fP from a client. TFO requires both the
client and \fBmongod/mongos\fP host machine support and enable
TFO:
.INDENT 7.0
.TP
.B Windows
The following Windows operating systems support TFO:
.INDENT 7.0
.IP \(bu 2
Microsoft Windows Server 2016 and later.
.IP \(bu 2
Microsoft Windows 10 Update 1607 and later.
.UNINDENT
.TP
.B macOS
macOS 10.11 (El Capitan) and later support TFO.
.TP
.B Linux
Linux operating systems running Linux Kernel 3.7 or later
can support inbound TFO.
.sp
Set the value of \fB/proc/sys/net/ipv4/tcp_fastopen\fP to
enable inbound TFO connections:
.INDENT 7.0
.IP \(bu 2
Set to \fB2\fP to enable only inbound TFO connections.
.IP \(bu 2
Set to \fB3\fP to enable inbound and outbound TFO connections.
.UNINDENT
.UNINDENT
.sp
This parameter has no effect if the host operating system does not
support \fIor\fP is not configured to support TFO connections.
.sp
You can only set this parameter on startup, using either the
\fBsetParameter\fP configuration file setting or the
\fB\-\-setParameter\fP command line option.
.sp
See 4.4\-rel\-notes\-tcp\-fast\-open for more information on
MongoDB TFO support.
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%RFC7413\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B tcpFastOpenClient
New in version 4.4.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIDefault\fP: \fBtrue\fP
.sp
\fILinux Operating System Only\fP
.sp
Enables support for outbound TCP Fast Open (TFO) connections from the
\fBmongod/mongos\fP to a client. TFO requires both the client
and the \fBmongod/mongos\fP host machine support and enable TFO.
.sp
Linux operating systems running Linux Kernel 4.11 or later can
support outbound TFO.
.sp
Set the value of \fB/proc/sys/net/ipv4/tcp_fastopen\fP to enable
outbound TFO connections:
.INDENT 7.0
.IP \(bu 2
\fB1\fP to enable only outbound TFO connections.
.IP \(bu 2
\fB3\fP to enable inbound and outbound TFO connections.
.UNINDENT
.sp
This parameter has no effect if the host operating system does not
support \fIor\fP is not configured to support TFO connections.
.sp
You can only set this parameter on startup, using either the
\fBsetParameter\fP configuration file setting or the
\fB\-\-setParameter\fP command line option.
.sp
See 4.4\-rel\-notes\-tcp\-fast\-open for more information on
MongoDB TFO support.
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%RFC7413\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B tcpFastOpenQueueSize
New in version 4.4.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIDefault\fP: \fB1024\fP
.sp
As part of establishing a TCP Fast Open (TFO) connection, the client
submits a valid TFO cookie to the \fBmongod/mongos\fP \fIbefore\fP
completion of the standard TCP 3\-way handshake. The
\fBmongod/mongos\fP keeps a queue of all such pending TFO connections.
.sp
The \fBtcpFastOpenQueueSize\fP parameter sets the size of the queue of
pending TFO connections. While the queue is full, the
\fBmongod/mongos\fP falls back to the normal three\-way handshake for
incoming client requests and ignores the presence of TFO cookies.
Once the queue size falls back below the limit, the \fBmongod/mongos\fP
begins accepting new TFO cookies.
.INDENT 7.0
.IP \(bu 2
Increasing the default queue size may improve the effect of
TFO on network performance. However, large queue sizes also
increase the risk of server resource exhaustion due to excessive
incoming TFO requests.
.IP \(bu 2
Decreasing the default queue size may reduce the risk of resource
server resource exhaustion due to excessive incoming TFO requests.
However, small queue sizes may also reduce the effect of TFO on
network performance.
.sp
The minimum queue size is \fB0\fP\&. A queue of \fB0\fP effectively
disables TFO.
.UNINDENT
.sp
This parameter has no effect on host operating systems that do
not support or are not configured for TFO connections. See
4.4\-rel\-notes\-tcp\-fast\-open for more information on
MongoDB TFO support.
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%RFC7413 TCP Fast Open Section 5: Security Considerations\fP
.IP \(bu 2
\fI\%RFC7413 TCP Fast Open Section 6: TFO Applicability\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B disableJavaScriptJIT
Changed in version 4.0: The JavaScript engine\(aqs JIT compiler is now disabled by default.
.sp
Available for \fBmongod\fP only.
.sp
The MongoDB JavaScript engine uses SpiderMonkey, which implements
Just\-in\-Time (JIT) compilation for improved performance when running scripts.
.sp
To enable the JIT, set \fI\%disableJavaScriptJIT\fP to \fBfalse\fP, as in
the following example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, disableJavaScriptJIT: false } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
\fB$where\fP will reuse existing JavaScript interpreter
contexts, so changes to \fI\%disableJavaScriptJIT\fP may not
take effect immediately for these operations.
.UNINDENT
.UNINDENT
.sp
Alternately, you may enable the JIT at startup time by starting the
\fBmongod\fP instance with the following option:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter disableJavaScriptJIT=false
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B maxIndexBuildMemoryUsageMegabytes
New in version 3.4.
.sp
\fIDefault\fP:
.INDENT 7.0
.IP \(bu 2
200 (For versions 4.2.3 and later)
.IP \(bu 2
500 (For versions 4.2.2 and earlier)
.UNINDENT
.sp
Limits the amount of memory that simultaneous index
builds on one collection may consume for the duration of the
builds. The specified amount of memory is shared between all
indexes built using a single
\fBcreateIndexes\fP command or its shell helper
\fBdb.collection.createIndexes()\fP\&.
.sp
The memory consumed by an index build is separate from the
WiredTiger cache memory (see
\fBcacheSizeGB\fP).
.sp
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
\fI\%maxIndexBuildMemoryUsageMegabytes\fP\&.
.sp
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 index
builds on multiple collections in multiple databases simultaneously
and potentially consume an amount of memory greater than the limit
set in \fI\%maxIndexBuildMemoryUsageMegabytes\fP\&.
.INDENT 7.0
.INDENT 3.5
.SS Tip
.sp
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
/tutorial/build\-indexes\-on\-replica\-sets\&.
.UNINDENT
.UNINDENT
.sp
Changed in version 4.2.
.INDENT 7.0
.IP \(bu 2
For feature compatibility version (fcv) \fB"4.2"\fP,
the index build memory limit applies to all index builds.
.IP \(bu 2
For feature compatibility version (fcv) \fB"4.0"\fP,
the index build memory limit only applies to foreground
index builds.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B reportOpWriteConcernCountersInServerStatus
New in version 4.0.6.
.sp
\fIDefault\fP: false
.sp
A boolean flag that determines whether the
\fBdb.serverStatus()\fP method and \fBserverStatus\fP
command return \fBopWriteConcernCounters\fP information. [1]
.sp
You can only set
\fI\%reportOpWriteConcernCountersInServerStatus\fP during
startup in the config file or on the command line. For example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter reportOpWriteConcernCountersInServerStatus=true
.ft P
.fi
.UNINDENT
.UNINDENT
.IP [1] 5
Enabling \fI\%reportOpWriteConcernCountersInServerStatus\fP
can have a negative performance impact; specificaly, when running
\fIwithout\fP TLS.
.UNINDENT
.INDENT 0.0
.TP
.B watchdogPeriodSeconds
Available for \fBmongod\fP only.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: \-1 (disabled)
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
Starting in MongoDB 4.2, the Storage Node Watchdog is available in both the Community and
MongoDB Enterprise editions.
.IP \(bu 2
In earlier versions (3.2.16+, 3.4.7+, 3.6.0+, 4.0.0+), the
Storage Node Watchdog is only
available in MongoDB Enterprise edition.
.UNINDENT
.UNINDENT
.UNINDENT
.sp
Determines how frequent the Storage Node Watchdog checks the status of the monitored
filesystems:
.INDENT 7.0
.IP \(bu 2
The \fB\-\-dbpath\fP directory
.IP \(bu 2
The \fBjournal\fP directory inside the \fB\-\-dbpath\fP directory if
\fBjournaling\fP is enabled
.IP \(bu 2
The directory of \fB\-\-logpath\fP file
.IP \(bu 2
The directory of \fB\-\-auditPath\fP file
.UNINDENT
.sp
Valid values for \fI\%watchdogPeriodSeconds\fP are:
.INDENT 7.0
.IP \(bu 2
\fB\-1\fP (the default), to disable/pause Storage Node Watchdog, or
.IP \(bu 2
An integer greater than or equal to 60.
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
If a filesystem on a monitored directory becomes unresponsive,
it can take a maximum of nearly \fItwice\fP the value of
\fI\%watchdogPeriodSeconds\fP to terminate the
\fBmongod\fP\&.
.IP \(bu 2
If any of its monitored directory is a symlink to other
volumes, the Storage Node Watchdog does not monitor the symlink
target. For example, if the \fBmongod\fP uses
\fBstorage.directoryPerDB: true\fP (or \fB\-\-directoryperdb\fP) and symlinks a database directory to
another volume, the Storage Node Watchdog does not follow the
symlink to monitor the target.
.UNINDENT
.UNINDENT
.UNINDENT
.sp
To enable Storage Node Watchdog,
\fI\%watchdogPeriodSeconds\fP must be set during startup.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter watchdogPeriodSeconds=60
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can only enable the Storage Node Watchdog at startup. However, once enabled, you can
pause the Storage Node Watchdog or
change the \fI\%watchdogPeriodSeconds\fP during runtime.
.sp
Once enabled,
.INDENT 7.0
.IP \(bu 2
To pause the Storage Node Watchdog
during runtime, set \fI\%watchdogPeriodSeconds\fP to \-1.
.INDENT 2.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, watchdogPeriodSeconds: \-1 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.IP \(bu 2
To resume or change the period during runtime, set
\fI\%watchdogPeriodSeconds\fP to a number greater than or
equal to 60.
.INDENT 2.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, watchdogPeriodSeconds: 120 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
It is an error to set \fI\%watchdogPeriodSeconds\fP at runtime if the
Storage Node Watchdog was not enabled at
startup time.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B tcmallocReleaseRate
New in version 4.2.3: \fIAlso available in 3.6.17+ and 4.0.14+\fP
.sp
Default: 1.0
.sp
Specifies the tcmalloc release rate (\fI\%TCMALLOC_RELEASE_RATE\fP).
Per \fI\%https://gperftools.github.io/gperftools/tcmalloc.html#runtime\fP
TCMALLOC_RELEASE_RATE is described as:
.INDENT 7.0
.INDENT 3.5
Rate at which we release unused memory to the system, via
madvise(MADV_DONTNEED), on systems that support it. Zero means we
never release memory back to the system. Increase this flag to
return memory faster; decrease it to return memory slower.
Reasonable rates are in the range [0,10].
\(em \fI\%https://gperftools.github.io/gperftools/tcmalloc.html#runtime\fP
.UNINDENT
.UNINDENT
.sp
To modify the release rate during runtime, you can use the
\fBsetParameter\fP command; for example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, tcmallocReleaseRate: 5.0 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can also set \fI\%tcmallocReleaseRate\fP at startup time;
for example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter "tcmallocReleaseRate=5.0"
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS Logging Parameters
.INDENT 0.0
.TP
.B logLevel
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Specify an integer between \fB0\fP and \fB5\fP signifying the verbosity
of the logging, where \fB5\fP is the
most verbose. [2]
.sp
The default \fI\%logLevel\fP is \fB0\fP (Informational).
.sp
The following example sets the \fI\%logLevel\fP to \fB2\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, logLevel: 2 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%logComponentVerbosity\fP
.IP \(bu 2
\fBsystemLog.verbosity\fP
.UNINDENT
.UNINDENT
.UNINDENT
.IP [2] 5
Starting in version 4.2, MongoDB includes the Debug verbosity level
(1\-5) in the log messages\&. For example,
if the verbosity level is 2, MongoDB logs \fBD2\fP\&. In previous
versions, MongoDB log messages only specified \fBD\fP for Debug level.
.UNINDENT
.INDENT 0.0
.TP
.B logComponentVerbosity
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Sets the verbosity levels of various components for log messages\&. The verbosity level determines the
amount of Informational and Debug
messages MongoDB outputs. [3]
.sp
The verbosity level can range from \fB0\fP to \fB5\fP:
.INDENT 7.0
.IP \(bu 2
\fB0\fP is the MongoDB\(aqs default log verbosity level, to include
Informational messages.
.IP \(bu 2
\fB1\fP to \fB5\fP increases the verbosity level to include
Debug messages.
.UNINDENT
.sp
For a component, you can also specify \fB\-1\fP to inherit the parent\(aqs
verbosity level.
.sp
To specify the verbosity level, use a document similar to the
following:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
{
verbosity: <int>,
<component1>: { verbosity: <int> },
<component2>: {
verbosity: <int>,
<component3>: { verbosity: <int> }
},
...
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For the components, you can specify just the \fB<component>: <int>\fP
in the document, unless you are setting both the parent verbosity
level and that of the child component(s) as well:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
{
verbosity: <int>,
<component1>: <int> ,
<component2>: {
verbosity: <int>,
<component3>: <int>
}
...
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The top\-level \fBverbosity\fP field corresponds to
\fBsystemLog.verbosity\fP which sets the default level for all
components. The default value of \fBsystemLog.verbosity\fP is
\fB0\fP\&.
.sp
The components correspond to the following settings:
.INDENT 7.0
.IP \(bu 2
\fBaccessControl\fP
.IP \(bu 2
\fBcommand\fP
.IP \(bu 2
\fBcontrol\fP
.IP \(bu 2
\fBftdc\fP
.IP \(bu 2
\fBgeo\fP
.IP \(bu 2
\fBindex\fP
.IP \(bu 2
\fBnetwork\fP
.IP \(bu 2
\fBquery\fP
.IP \(bu 2
\fBreplication\fP
.IP \(bu 2
\fBreplication.election\fP
.IP \(bu 2
\fBreplication.heartbeats\fP
.IP \(bu 2
\fBreplication.initialSync\fP
.IP \(bu 2
\fBreplication.rollback\fP
.IP \(bu 2
\fBrecovery\fP
.IP \(bu 2
\fBsharding\fP
.IP \(bu 2
\fBstorage\fP
.IP \(bu 2
\fBstorage.journal\fP
.IP \(bu 2
\fBtransaction\fP
.IP \(bu 2
\fBwrite\fP
.UNINDENT
.sp
Unless explicitly set, the component has the verbosity level of its
parent. For example, \fBstorage\fP is the parent of
\fBstorage.journal\fP\&. That is, if you specify a \fBstorage\fP verbosity level, this level
also applies to:
.INDENT 7.0
.IP \(bu 2
\fBstorage.journal\fP components
\fIunless\fP you specify the verbosity level for
\fBstorage.journal\fP\&.
.IP \(bu 2
\fBstorage.recovery\fP components
\fIunless\fP you specify the verbosity level for
\fBstorage.recovery\fP\&.
.UNINDENT
.sp
For example, the following sets the \fBdefault verbosity
level\fP to \fB1\fP, the \fBquery\fP to \fB2\fP, the
\fBstorage\fP to \fB2\fP,
and the \fBstorage.journal\fP to \fB1\fP\&.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( {
setParameter: 1,
logComponentVerbosity: {
verbosity: 1,
query: { verbosity: 2 },
storage: {
verbosity: 2,
journal: {
verbosity: 1
}
}
}
} )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can also set parameter \fI\%logComponentVerbosity\fP at
startup time, passing the verbosity level document as a string.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter "logComponentVerbosity={command: 3}"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fBmongo\fP shell also provides the \fBdb.setLogLevel()\fP
to set the log level for a single component. For various ways to set
the log verbosity level, see log\-messages\-configure\-verbosity\&.
.IP [3] 5
Starting in version 4.2, MongoDB includes the Debug verbosity level
(1\-5) in the log messages\&. For example,
if the verbosity level is 2, MongoDB logs \fBD2\fP\&. In previous
versions, MongoDB log messages only specified \fBD\fP for Debug level.
.UNINDENT
.INDENT 0.0
.TP
.B maxLogSizeKB
New in version 3.4.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: non\-negative integer
.sp
\fIDefault\fP: 10
.sp
Specifies the maxium size, in kilobytes, for an individual
attribute field in a log entry; attributes exceeding this limit are
truncated.
.sp
Truncated attribute fields print field content up to the
\fI\%maxLogSizeKB\fP limit and excise field content past that
limit, retaining valid JSON formating. Log entires that contain
truncated attributes append a \fBtruncated\fP object to the end of the
log entry.
.sp
See log message truncation for more
information.
.sp
A value of \fB0\fP disables truncation entirely. Negative values for
this parameter are not valid.
.sp
\fBWARNING:\fP
.INDENT 7.0
.INDENT 3.5
Using a large value, or disabling truncation with a value of
\fB0\fP, may adversely affect system performance and negatively
impact database operations.
.UNINDENT
.UNINDENT
.sp
The following example sets the maximum log line size to \fB20\fP
kilobytes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter maxLogSizeKB=20
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B quiet
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Sets quiet logging mode. If
\fB1\fP, \fBmongod\fP will go into a quiet logging
mode which will not log the following events/activities:
.INDENT 7.0
.IP \(bu 2
connection events;
.IP \(bu 2
the \fBdrop\fP command, the
\fBdropIndexes\fP command, the
\fBdiagLogging\fP command, the
\fBvalidate\fP command, and the
\fBclean\fP command; and
.IP \(bu 2
replication synchronization activities.
.UNINDENT
.sp
Consider the following example which sets the
\fBquiet\fP to \fB1\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, quiet: 1 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fBsystemLog.quiet\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B redactClientLogData
New in version 3.4.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: boolean
.INDENT 7.0
.INDENT 3.5
.IP "Enterprise Feature"
.sp
Available in MongoDB Enterprise only.
.UNINDENT
.UNINDENT
.sp
Configure the \fBmongod\fP or \fBmongos\fP to
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.
.sp
Use \fI\%redactClientLogData\fP in conjunction with
/core/security\-encryption\-at\-rest and
/core/security\-transport\-encryption to assist compliance with
regulatory requirements.
.sp
To enable log redaction on a running \fBmongod\fP or
\fBmongos\fP, use the following command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, redactClientLogData : true } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fBsecurity.redactClientLogData\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B traceExceptions
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Configures \fBmongod\fP to log full source code stack traces
for every database and socket C++ exception, for use with debugging.
If \fBtrue\fP, \fBmongod\fP will log full stack traces.
.sp
Consider the following example which sets the
\fBtraceExceptions\fP to \fBtrue\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, traceExceptions: true } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fBsystemLog.traceAllExceptions\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B suppressNoTLSPeerCertificateWarning
New in version 4.0.1.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: boolean
.sp
\fIDefault\fP: false
.sp
By default, a \fBmongod\fP or \fBmongos\fP with
TLS/SSL enabled and
\fBnet.ssl.allowConnectionsWithoutCertificates\fP : \fBtrue\fP
lets clients connect without providing a certificate for
validation while logging an warning. Set
\fBsuppressNoTLSPeerCertificateWarning\fP to \fB1\fP or \fBtrue\fP to
suppress those warnings.
.sp
The following operation sets \fBsuppressNoTLSPeerCertificateWarning\fP
to \fBtrue\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, suppressNoTLSPeerCertificateWarning: true} )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS Diagnostic Parameters
.sp
To facilitate analysis of the MongoDB server behavior by MongoDB
engineers, MongoDB logs server statistics to diagnostic files at
periodic intervals.
.sp
For \fBmongod\fP, the diagnostic data files are stored in the
\fBdiagnostic.data\fP directory under the \fBmongod\fP instance\(aqs
\fB\-\-dbpath\fP or \fBstorage.dbPath\fP\&.
.sp
For \fBmongos\fP, the diagnostic data files, by default, are
stored in a directory under the \fBmongos\fP instance\(aqs
\fB\-\-logpath\fP or \fBsystemLog.path\fP directory. The diagnostic
data directory is computed by truncating the logpath\(aqs file
extension(s) and concatenating \fBdiagnostic.data\fP to the remaining
name.
.sp
For example, if \fBmongos\fP has \fB\-\-logpath
/var/log/mongodb/mongos.log.201708015\fP, then the diagnostic data
directory is \fB/var/log/mongodb/mongos.diagnostic.data/\fP directory. To
specify a different diagnostic data directory for \fBmongos\fP,
set the \fI\%diagnosticDataCollectionDirectoryPath\fP parameter.
.sp
The following parameters support diagnostic data capture (FTDC):
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
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.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B diagnosticDataCollectionEnabled
New in version 3.2.
.sp
Changed in version 3.4.14: Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: boolean
.sp
\fIDefault\fP: true
.sp
Determines whether to enable the collecting and logging of data for
diagnostic purposes. Diagnostic logging is enabled by default.
.sp
For example, the following disables the diagnostic collection:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter diagnosticDataCollectionEnabled=false
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B diagnosticDataCollectionDirectoryPath
New in version 3.4.14.
.sp
\fIType\fP: String
.sp
Available for \fBmongos\fP only.
.sp
Specify the directory for the diagnostic directory for
\fBmongos\fP\&. If the directory does not exist,
\fBmongos\fP creates the directory.
.sp
If unspecified, the diagnostic data directory is computed by
truncating the \fBmongos\fP instance\(aqs \fB\-\-logpath\fP or
\fBsystemLog.path\fP file extension(s) and concatenating
\fBdiagnostic.data\fP\&.
.sp
For example, if \fBmongos\fP has \fB\-\-logpath
/var/log/mongodb/mongos.log.201708015\fP, then the diagnostic data
directory is \fB/var/log/mongodb/mongos.diagnostic.data/\fP\&.
.sp
\fBIMPORTANT:\fP
.INDENT 7.0
.INDENT 3.5
If \fBmongos\fP cannot 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.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B diagnosticDataCollectionDirectorySizeMB
New in version 3.2.
.sp
Changed in version 3.4: Increased default size to 200 megabytes.
.sp
Changed in version 3.4.14: Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 200
.sp
Specifies the maximum size, in megabytes, of the \fBdiagnostic.data\fP
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.
.sp
For example, the following sets the maximum size of the directory to
\fB250\fP megabytes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter diagnosticDataCollectionDirectorySizeMB=250
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The minimum value for
\fI\%diagnosticDataCollectionDirectorySizeMB\fP is \fB10\fP
megabytes. \fI\%diagnosticDataCollectionDirectorySizeMB\fP must
be greater than maximum diagnostic file size
\fI\%diagnosticDataCollectionFileSizeMB\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B diagnosticDataCollectionFileSizeMB
New in version 3.2.
.sp
Changed in version 3.4.14: Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 10
.sp
Specifies the maximum size, in megabytes, of each diagnostic
file\&. If the file exceeds the maximum
file size, MongoDB creates a new file.
.sp
For example, the following sets the maximum size of each diagnostic
file to \fB20\fP megabytes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter diagnosticDataCollectionFileSizeMB=20
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The minimum value for
\fI\%diagnosticDataCollectionFileSizeMB\fP is \fB1\fP megabyte.
.UNINDENT
.INDENT 0.0
.TP
.B diagnosticDataCollectionPeriodMillis
New in version 3.2.
.sp
Changed in version 3.4.14: Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 1000
.sp
Specifies the interval, in milliseconds, at which to collect
diagnostic data.
.sp
For example, the following sets the interval to
\fB5000\fP milliseconds or 5 seconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter diagnosticDataCollectionPeriodMillis=5000
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The minimum value for
\fI\%diagnosticDataCollectionPeriodMillis\fP is \fB100\fP
milliseconds.
.UNINDENT
.SS Logical Session Parameters
.INDENT 0.0
.TP
.B logicalSessionRefreshMillis
.INDENT 7.0
.INDENT 3.5
.IP "Availability"
.sp
New in version 4.0.4 (and version 3.6.9).
.UNINDENT
.UNINDENT
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 300000 (i.e. 5 minutes)
.sp
The interval (in milliseconds) at which the cache refreshes its logical
session records against the main session store.
.sp
You can only set \fI\%logicalSessionRefreshMillis\fP at
startup and cannot change this setting with the
\fBsetParameter\fP command.
.sp
For example, to set the \fI\%logicalSessionRefreshMillis\fP
for a \fBmongod\fP instance to 10 minutes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter logicalSessionRefreshMillis=600000
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B localLogicalSessionTimeoutMinutes
New in version 3.6.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 30
.INDENT 7.0
.INDENT 3.5
.IP "For testing purposes only"
.sp
This parameter is intended for testing purposes only and not for
production use.
.UNINDENT
.UNINDENT
.sp
The time in minutes that a session remains active
after its most recent use. Sessions that have not received a new
read/write operation from the client or been refreshed with
\fBrefreshSessions\fP within this threshold are cleared from the
cache. State associated with an expired session may be cleaned up by the
server at any time.
.sp
This parameter applies only to the instance on which it is set. To
set this parameter on replica sets and sharded clusters, you must
specify the same value on every member; otherwise, sessions will
not function properly.
.sp
You can only set \fI\%localLogicalSessionTimeoutMinutes\fP at
startup and cannot change this setting with the
\fBsetParameter\fP command.
.sp
For example, to set the \fI\%localLogicalSessionTimeoutMinutes\fP
for a test \fBmongod\fP instance to 20 minutes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter localLogicalSessionTimeoutMinutes=20
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B maxAcceptableLogicalClockDriftSecs
New in version 3.6.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 31536000 (1 year)
.sp
The maximum amount by which the current cluster time can be advanced;
i.e., \fI\%maxAcceptableLogicalClockDriftSecs\fP is the maximum
difference between the new value of the cluster time and the current
cluster time. Cluster time is a logical time used for ordering of
operations.
.sp
You cannot advance the cluster time to a new value if the new
cluster time differs from the current cluster time by more than
\fI\%maxAcceptableLogicalClockDriftSecs\fP,
.sp
You can only set \fI\%maxAcceptableLogicalClockDriftSecs\fP at
startup and cannot change this setting with the
\fBsetParameter\fP command.
.sp
For example, to set the \fI\%maxAcceptableLogicalClockDriftSecs\fP
for a \fBmongod\fP instance to 15 minutes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter maxAcceptableLogicalClockDriftSecs=900
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B maxSessions
New in version 4.0.1.
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 1000000
.sp
The maximum number of sessions that can be cached.
.sp
You can only set \fI\%maxSessions\fP during start\-up.
.sp
For example, to set the \fI\%maxSessions\fP
for a \fBmongod\fP instance to 1000:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter maxSessions=1000
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B TransactionRecordMinimumLifetimeMinutes
New in version 3.6.
.sp
Available for \fBmongod\fP only.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 30
.sp
The minimum lifetime a transaction record exists in the
\fBtransactions\fP collection before the record becomes
eligible for cleanup.
.sp
You can only set \fI\%TransactionRecordMinimumLifetimeMinutes\fP at
startup and cannot change this setting with the
\fBsetParameter\fP command.
.sp
For example, to set the \fI\%TransactionRecordMinimumLifetimeMinutes\fP
for a \fBmongod\fP instance to 20 minutes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter TransactionRecordMinimumLifetimeMinutes=20
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%localLogicalSessionTimeoutMinutes\fP
.UNINDENT
.UNINDENT
.UNINDENT
.SS Replication Parameters
.INDENT 0.0
.TP
.B enableFlowControl
New in version 4.2.
.sp
\fIType\fP: boolean
.sp
\fIDefault\fP: true
.sp
Enables or disables the mechanism that controls the rate at which the
primary applies its writes with the goal of keeping the secondary members\(aq
\fBmajority committed\fP lag under a
configurable maximum value.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
For flow control to engage, the replica set/sharded cluster must
have: featureCompatibilityVersion (FCV) of
\fB4.2\fP and read concern \fBmajority enabled\fP\&. That is, enabled flow
control has no effect if FCV is not \fB4.2\fP or if read concern
majority is disabled.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B flowControlTargetLagSeconds
New in version 4.2.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 10
.sp
The target maximum \fBmajority committed\fP lag when running
with flow control. When flow control is enabled, the mechanism
attempts to keep the \fBmajority committed\fP lag under
the specified seconds. The parameter has no effect if flow control
is disabled.
.sp
The specified value must be greater than 0.
.sp
In general, the default settings should suffice; however, if
modifying from the default value, decreasing, rather than
increasing, the value may prove to be more useful.
.UNINDENT
.INDENT 0.0
.TP
.B flowControlWarnThresholdSeconds
New in version 4.2.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 10
.sp
The amount of time to wait to log a warning once the flow control
mechanism detects the majority commit point has not moved.
.sp
The specified value must be greater than or equal to 0, with 0 to
disable warnings.
.UNINDENT
.INDENT 0.0
.TP
.B initialSyncTransientErrorRetryPeriodSeconds
New in version 4.4.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 86400
.sp
The amount of time in seconds a secondary performing initial sync
attempts to resume the process if interrupted by a transient
network error. The default value is equivalent to 24 hours.
.UNINDENT
.INDENT 0.0
.TP
.B initialSyncSourceReadPreference
New in version 4.4.
.sp
\fIType\fP: String
.sp
Available for \fBmongod\fP only.
.sp
The preferred source for performing initial sync\&. Specify one of the following read
preference modes:
.INDENT 7.0
.IP \(bu 2
\fBprimary\fP
.IP \(bu 2
\fBprimaryPreferred\fP (Default for voting replica set members)
.IP \(bu 2
\fBsecondary\fP
.IP \(bu 2
\fBsecondaryPreferred\fP
.IP \(bu 2
\fBnearest\fP (Default for newly added \fIor\fP non\-voting replica set members)
.UNINDENT
.sp
If the replica set has disabled \fBchaining\fP, the default
\fI\%initialSyncSourceReadPreference\fP read preference mode
is \fBprimary\fP\&.
.sp
You cannot specify a tag set or \fBmaxStalenessSeconds\fP to
\fI\%initialSyncSourceReadPreference\fP\&.
.sp
If the \fBmongod\fP cannot find a sync source based on the
specified read preference, it logs an error and restarts the initial
sync process. The \fBmongod\fP exits with an error if it
cannot complete the initial sync process after \fB10\fP attempts. For
more information on sync source selection, see
replica\-set\-initial\-sync\-source\-selection\&.
.sp
\fI\%initialSyncSourceReadPreference\fP takes precedence over
the replica set\(aqs \fBsettings.chainingAllowed\fP setting when
selecting an initial sync source. After a replica set member
successfully completes initial sync, it defers to the value of
\fBchainingAllowed\fP when selecting a replication sync
source.
.sp
You can only set this parameter on startup, using either the
\fBsetParameter\fP
configuration file setting or the
\fB\-\-setParameter\fP command line option.
.UNINDENT
.INDENT 0.0
.TP
.B oplogInitialFindMaxSeconds
New in version 3.6.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 60
.sp
Available for \fBmongod\fP only.
.sp
Maximum time in seconds for a member of a replica set to wait
for the \fBfind\fP command to finish during
data synchronization\&.
.UNINDENT
.INDENT 0.0
.TP
.B replWriterThreadCount
New in version 3.2.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 16
.sp
Available for \fBmongod\fP only.
.sp
Number of threads to use to apply replicated operations in parallel.
Values can range from 1 to 256 inclusive. You can only set
\fI\%replWriterThreadCount\fP at startup and cannot change this
setting with the \fBsetParameter\fP command.
.UNINDENT
.INDENT 0.0
.TP
.B rollbackTimeLimitSecs
\fIType\fP: 64\-bit integer
.sp
\fIDefault\fP: 86400 (1 day)
.sp
Maximum age of data that can be rolled back. Negative values for
this parameter are not valid.
.sp
Starting in MongoDB 4.2+ and 4.0.13+, if the time between the end
of the to\-be\-rolledback instance\(aqs oplog and the first operation
after the common point (the last point where the source node and the
to\-be\-rolledback node had the same data) exceeds this value, the
rollback will fail.
.sp
In MongoDB 4.0.0\-4.0.12, if the time between the end of the to\-be\-rolledback
instance\(aqs oplog and the common point (the last point where the
source node and the to\-be\-rolledback node had the same data) exceeds
this value, the rollback will fail.
.sp
To effectively have an unlimited rollback period, set the value to
\fB2147483647\fP which is the maximum value allowed and equivalent to
roughly 68 years.
.sp
New in version 4.0.
.UNINDENT
.INDENT 0.0
.TP
.B waitForSecondaryBeforeNoopWriteMS
New in version 3.6.
.sp
Available for \fBmongod\fP only.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 10
.sp
The length of time (in milliseconds) that a secondary must wait if
the \fBafterClusterTime\fP is greater than the last applied time from
the oplog. After the \fBwaitForSecondaryBeforeNoopWriteMS\fP passes,
if the \fBafterClusterTime\fP is still greater than the last applied
time, the secondary makes a no\-op write to advance the last applied
time.
.sp
The following example sets the
\fI\%waitForSecondaryBeforeNoopWriteMS\fP to 20 milliseconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter waitForSecondaryBeforeNoopWriteMS=20
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
During runtime, you can also set the parameter with the
\fBsetParameter\fP command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, waitForSecondaryBeforeNoopWriteMS: 20 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B createRollbackDataFiles
Available for \fBmongod\fP only.
.sp
\fIType\fP: boolean
.sp
\fIDefault\fP: true
.sp
New in version 4.0.
.sp
Flag that determines whether MongoDB creates rollback files that contains documents affected during a
rollback.
.sp
By default, \fI\%createRollbackDataFiles\fP is \fBtrue\fP and
MongoDB creates the rollback files.
.sp
The following example sets \fI\%createRollbackDataFiles\fP
to false so that the rollback files are not created:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter createRollbackDataFiles=false
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
During runtime, you can also set the parameter with the
\fBsetParameter\fP command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, createRollbackDataFiles: false } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For more information, see rollback\-data\-files\&.
.UNINDENT
.INDENT 0.0
.TP
.B enableElectionHandoff
New in version 4.0.2.
.sp
\fIType\fP: boolean
.sp
\fIDefault\fP: true
.sp
A flag that can reduce the downtime after the primary steps down
from either the \fBrs.stepDown()\fP method or the
\fBreplSetStepDown\fP command. Specifically, if true, when a
primary steps down after \fBrs.stepDown()\fP (or the
\fBreplSetStepDown\fP command without the \fBforce: true\fP),
it nominates an eligible secondary to call an election immediately.
If false, after the step down, secondaries can wait up to
\fBsettings.electionTimeoutMillis\fP before calling an election.
.sp
An eligible secondary must be caught up with the stepped down
primary and have \fBpriority\fP greater than 0. If
multiple secondary members meet this criteria, the stepped down
primary selects the eligible secondary with the highest
\fBpriority\fP\&. If the more than one eligible
secondary members have the same \fBpriority\fP, the
stepped down primary selects the secondary with the lowest
\fB_id\fP\&. The stepped down primary does not wait
for the effects of the handoff.
.sp
The parameter has no impact if the primary steps down for reasons
other than \fBrs.stepDown()\fP (or the
\fBreplSetStepDown\fP command without the \fBforce: true\fP).
.UNINDENT
.INDENT 0.0
.TP
.B replBatchLimitBytes
\fIDefault\fP: 104857600 (100MB)
.sp
Sets the maximum oplog application batch size in bytes.
.sp
Values can range from 16777216 (16MB) to 104857600 (100MB) inclusive.
.sp
The following example sets \fI\%replBatchLimitBytes\fP
to 64 MB so that the rollback files are not created:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter replBatchLimitBytes=67108864
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
During runtime, you can also set the parameter with the
\fBsetParameter\fP command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, replBatchLimitBytes: 64 * 1024 * 1024 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
New in version 4.0.10.
.UNINDENT
.INDENT 0.0
.TP
.B mirrorReads
Available for \fBmongod\fP only.
.sp
\fINew in version 4.4\fP
.sp
\fIType\fP: Document
.sp
\fIDefault\fP: \fB{ samplingRate: 0.01, maxTimeMS: 1000 }\fP
.sp
Specifies the settings for mirrored reads
for the \fBmongod\fP instance. The settings only take
effect when the member is a primary.
.sp
The parameter \fI\%mirrorReads\fP takes a JSON document with
the following fields:
.TS
center;
|l|l|.
_
T{
Field
T} T{
Description
T}
_
T{
\fBsamplingRate\fP
T} T{
The sampling rate used to mirror a subset of operations
that support mirroring
to a subset of electable (i.e. \fBpriority greater than
0\fP) secondaries. That is, the primary
mirrors reads to each electable secondary at the specified
sampling rate.
.sp
Valid values are greater than or equal to \fB0.0\fP and less
than or equal to \fB1.0\fP\&. Value of \fB0.0\fP turns off mirroring.
.sp
For example, given a replica set with a primary and two
electable secondaries and a sampling rate of \fB0.10\fP, the
primary mirrors reads to each electable secondary at the
sampling rate of 10 percent such that one read may be
mirrored to one secondary and not to the other or to both or
to neither. That is, if the primary receives \fB100\fP
operations that can be mirrored, the sampling rate of
\fB0.10\fP may result in \fB8\fP reads being mirrored to one
secondary and \fB13\fP reads to the other or \fB10\fP to each,
etc.
.sp
The default value is \fB0.01\fP\&.
T}
_
T{
\fBmaxTimeMS\fP
T} T{
The maximum time in milliseconds for the mirrored reads. The
default value is \fB1000\fP\&.
.sp
The \fBmaxTimeMS\fP for the mirrored reads is separate from the
\fBmaxTimeMS\fP of the original read being mirrored.
T}
_
.TE
.sp
You can set \fI\%mirrorReads\fP during startup in the
\fBconfiguration file\fP or with the
\fB\-\-setParameter\fP option on the command line. If specifying from
the configuration file or on the command line, \fBenclose the\fP
\fBmirrorReads\fP \fBdocument in quotes\fP\&.
.sp
For example, the following sets the mirror reads sampling rate to
\fB0.10\fP from the command line:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter mirrorReads=\(aq{ samplingRate: 0.10 }\(aq
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or, to specify in a configuration file:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
setParameter:
mirrorReads: \(aq{samplingRate: 0.10}\(aq
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or if using the \fBsetParameter\fP command in a
\fBmongo\fP shell connected to a running
\fBmongod\fP, do \fBnot\fP enclose the document in quotes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, mirrorReads: { samplingRate: 0.10 } } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS Sharding Parameters
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Starting in version 4.2, MongoDB removes the parameter
\fBAsyncRequestsSenderUseBaton\fP and always enables the performance
enhancement controlled by the parameter.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B enableShardedIndexConsistencyCheck
\fINew in version 4.4 (and 4.2.6).\fP
.sp
\fIType\fP: boolean
.sp
\fIDefault\fP: true
.sp
Available for \fBmongod\fP only.
.sp
If set on the config server\(aqs primary, enables or disables the index
consistency check for sharded collections. The parameter has no
effect on the \fBmongod\fP if it is not the config server\(aqs
primary.
.sp
The following example sets
\fI\%enableShardedIndexConsistencyCheck\fP to \fBfalse\fP for a
config server primary:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter enableShardedIndexConsistencyCheck=false
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
During runtime, you can also set the parameter with the
\fBsetParameter\fP command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, enableShardedIndexConsistencyCheck: false } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%shardedIndexConsistencyCheckIntervalMS\fP parameter
.IP \(bu 2
\fBshardedIndexConsistency\fP metrics returned by the
\fBserverStatus\fP command.
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B shardedIndexConsistencyCheckIntervalMS
\fINew in version 4.4 (and 4.2.6).\fP
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 600000
.sp
Available for \fBmongod\fP only.
.sp
If set on the config server\(aqs primary, the interval, in
milliseconds, at which the config server\(aqs primary checks the index
consistency of sharded collections. The parameter has no effect on
the \fBmongod\fP if it is not the config server\(aqs primary.
.sp
You can only set the parameter during startup, and cannot change
this setting using the \fBsetParameter\fP database command.
.sp
For example, the following sets the interval at 300000 milliseconds
(i.e. 5 minutes) at startup:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter shardedIndexConsistencyCheckIntervalMS=300000
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%enableShardedIndexConsistencyCheck\fP parameter
.IP \(bu 2
\fBshardedIndexConsistency\fP metrics returned by the
\fBserverStatus\fP commandq
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B maxTimeMSForHedgedReads
New in version 4.4.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 150
.sp
Available for \fBmongos\fP only.
.sp
Specifies the maximimum time limit (in milliseconds) for the
hedged read\&. That is, the additional
read sent to hedge the read operation uses the \fBmaxTimeMS\fP value
of \fI\%maxTimeMSForHedgedReads\fP while the read operation
that is being hedged uses the \fBmaxTimeMS\fP value specified for the
operation.
.sp
For example, to set the limit to 200 milliseconds, you can issue the
following during startup:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter maxTimeMSForHedgedReads=200
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or if using the \fBsetParameter\fP command in a
\fBmongo\fP shell connected to a running
\fBmongos\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, maxTimeMSForHedgedReads: 200 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%readHedgingMode\fP
.IP \(bu 2
mongos\-hedged\-reads
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B readHedgingMode
New in version 4.4.
.sp
\fIType\fP: string
.sp
\fIDefault\fP: on
.sp
Available for \fBmongos\fP only.
.sp
Specifies whether \fBmongos\fP supports hedged reads for
those read operations whose read preference have enabled the hedged read option.
.sp
Available values are:
.TS
center;
|l|l|.
_
T{
Value
T} T{
Description
T}
_
T{
\fBon\fP
T} T{
The \fBmongos\fP instance supports hedged reads for
read operations whose read preference have enabled the hedged read option.
T}
_
T{
\fBoff\fP
T} T{
The \fBmongos\fP instance does not support hedged
reads. That is, hedged reads are unavailable, even for read
operations whose read preference have enabled the hedged read
option.
T}
_
.TE
.sp
For example, to turn off hedged read support for a
\fBmongos\fP instance, you can issue the following during
startup:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter readHedgingMode=off
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or if using the \fBsetParameter\fP command in a
\fBmongo\fP shell connected to a running
\fBmongos\fP:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, readHedgingMode: "off" } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
mongos\-hedged\-reads
.IP \(bu 2
\fI\%maxTimeMSForHedgedReads\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B replMonitorMaxFailedChecks
\fIAvailable in MongoDB 3.2 only\fP
.sp
Type: integer
.sp
Default: 30
.sp
The number of times the \fBmongod\fP or \fBmongos\fP
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.
.sp
When the number of consecutive unsuccessful attempts exceeds this
parameter value, the \fBmongod\fP or \fBmongos\fP instance
denotes the monitored replica set as unavailable. If the monitored
replica set is the config server replica set:
.INDENT 7.0
.IP \(bu 2
For MongoDB 3.2.0\-3.2.9, the monitoring \fBmongod\fP or
\fBmongos\fP instance will become unusable and needs to be
restarted. See the \fI\%v3.2 troubleshooting guide\fP
for more details.
.IP \(bu 2
For MongoDB 3.2.10 and later 3.2\-series, see also
\fI\%timeOutMonitoringReplicaSets\fP\&.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B timeOutMonitoringReplicaSets
\fIAvailable in MongoDB 3.2.10 and later 3.2\-series only\fP
.sp
Type: integer
.sp
Default: false
.sp
The flag that determines whether the \fBmongod\fP or
\fBmongos\fP instance should stop its attempt to reach the
monitored replica set after unsuccessfully trying
\fI\%replMonitorMaxFailedChecks\fP number of times.
.sp
If the monitored replica set is the config server replica set and
\fI\%timeOutMonitoringReplicaSets\fP is set to \fBtrue\fP, you
must restart \fBmongod\fP or \fBmongos\fP if the
\fBmongod\fP or \fBmongos\fP instance cannot reach any of
the config servers for the specified number of times. See the
\fI\%v3.2 troubleshooting guide\fP
for more details.
.UNINDENT
.INDENT 0.0
.TP
.B ShardingTaskExecutorPoolHostTimeoutMS
Type: integer
.sp
Default: 300000 (i.e. 5 minutes)
.sp
Available for \fBmongos\fP only.
.sp
Maximum time that \fBmongos\fP goes without communication to a
host before \fBmongos\fP drops all connections to the host.
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.sp
If set, \fI\%ShardingTaskExecutorPoolHostTimeoutMS\fP should be
greater than the sum of
\fI\%ShardingTaskExecutorPoolRefreshRequirementMS\fP and
\fI\%ShardingTaskExecutorPoolRefreshTimeoutMS\fP\&. Otherwise,
\fBmongos\fP adjusts the value of
\fI\%ShardingTaskExecutorPoolHostTimeoutMS\fP to be greater than the
sum.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter ShardingTaskExecutorPoolHostTimeoutMS=120000
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B ShardingTaskExecutorPoolMaxConnecting
New in version 3.6.
.sp
Type: integer
.sp
Default: 2
.sp
Available for \fBmongos\fP only.
.sp
Maximum number of simultaneous initiating connections (including
pending connections in setup/refresh state) each TaskExecutor
connection pool can have to a \fBmongod\fP instance. You can
set this parameter to control the rate at which \fBmongos\fP
adds connections to a \fBmongod\fP instance.
.sp
If set, \fI\%ShardingTaskExecutorPoolMaxConnecting\fP should be
less than or equal to \fI\%ShardingTaskExecutorPoolMaxSize\fP\&.
If it is greater, \fBmongos\fP ignores the
\fI\%ShardingTaskExecutorPoolMaxConnecting\fP value.
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter ShardingTaskExecutorPoolMaxConnecting=20
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B ShardingTaskExecutorPoolMaxSize
Type: integer
.sp
Default: 2\s-2\u64\d\s0 \- 1
.sp
Available for \fBmongos\fP only.
.sp
Maximum number of outbound connections each TaskExecutor connection
pool can open to any given \fBmongod\fP instance. The maximum
possible connections to any given host across all TaskExecutor pools
is:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
ShardingTaskExecutorPoolMaxSize * taskExecutorPoolSize
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter ShardingTaskExecutorPoolMaxSize=4
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBmongos\fP can have up to \fBn\fP TaskExecutor connection
pools, where \fBn\fP is the number of cores. See
\fI\%taskExecutorPoolSize\fP\&.
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%ShardingTaskExecutorPoolMinSize\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B ShardingTaskExecutorPoolMinSize
Type: integer
.sp
Default: 1
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Minimum number of outbound connections each TaskExecutor connection
pool can open to any given \fBmongod\fP instance.
.sp
\fBShardingTaskExecutorPoolMinSize\fP 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 until \fI\%ShardingTaskExecutorPoolHostTimeoutMS\fP
milliseconds pass without any application using that pool.
.sp
For a \fBmongos\fP using the
\fI\%warmMinConnectionsInShardingTaskExecutorPoolOnStartup\fP
parameter, the \fBShardingTaskExecutorPoolMinSize\fP parameter also
controls how many connections to each shard host are established on
startup of the \fBmongos\fP instance before it begins
accepting incoming client connections.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
In MongoDB 4.4, the
\fI\%warmMinConnectionsInShardingTaskExecutorPoolOnStartup\fP
parameter is enabled by default for the \fBmongos\fP\&.
.UNINDENT
.UNINDENT
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter ShardingTaskExecutorPoolMinSize=2
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBmongos\fP can have up to \fBn\fP TaskExecutor connection
pools, where \fBn\fP is the number of cores. See
\fI\%taskExecutorPoolSize\fP\&.
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%ShardingTaskExecutorPoolMaxSize\fP
.IP \(bu 2
\fI\%warmMinConnectionsInShardingTaskExecutorPoolOnStartup\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B ShardingTaskExecutorPoolRefreshRequirementMS
Type: integer
.sp
Default: 60000 (1 minute)
.sp
Available for \fBmongos\fP only.
.sp
Maximum time the \fBmongos\fP waits before attempting to
heartbeat a resting connection in the pool.
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.sp
If set, \fI\%ShardingTaskExecutorPoolRefreshRequirementMS\fP should be
greater than \fI\%ShardingTaskExecutorPoolRefreshTimeoutMS\fP\&.
Otherwise, \fBmongos\fP adjusts the value of
\fI\%ShardingTaskExecutorPoolRefreshTimeoutMS\fP to be less than
\fI\%ShardingTaskExecutorPoolRefreshRequirementMS\fP\&.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter ShardingTaskExecutorPoolRefreshRequirementMS=90000
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B ShardingTaskExecutorPoolRefreshTimeoutMS
Type: integer
.sp
Default: 20000 (20 seconds)
.sp
Available for \fBmongos\fP only.
.sp
Maximum time the \fBmongos\fP waits for a heartbeat before
timing out the heartbeat.
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.sp
If set, \fI\%ShardingTaskExecutorPoolRefreshTimeoutMS\fP should be
less than \fI\%ShardingTaskExecutorPoolRefreshRequirementMS\fP\&.
Otherwise, \fBmongos\fP adjusts the value of
\fI\%ShardingTaskExecutorPoolRefreshTimeoutMS\fP to be less than
\fI\%ShardingTaskExecutorPoolRefreshRequirementMS\fP\&.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter ShardingTaskExecutorPoolRefreshTimeoutMS=30000
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B ShardingTaskExecutorPoolReplicaSetMatching
New in version 4.2.
.sp
Type: string
.sp
Default: "matchPrimaryNode"
.sp
Available for \fBmongos\fP only.
.sp
The policy that determines the minimum size limit of the
\fBmongos\fP instance\(aqs connection pools to the sharded
cluster\(aqs replica set secondaries.
.sp
Available values are:
.TS
center;
|l|l|.
_
T{
Matching Policy
T} T{
Description
T}
_
T{
\fB"matchPrimaryNode"\fP (Default)
T} T{
For each replica set in the sharded cluster (i.e. shard
replica set and config servers), the minimum size limit of
the \fBmongos\fP instance\(aqs connection pool to each
secondary of that replica set is equal to the size of its
connection pool to the primary.
.sp
In case of primary stepdown, \fBmatchPrimaryNode\fP ensures
that any secondary that becomes the primary can handle the
current level of primary reads and writes.
T}
_
T{
\fB"matchBusiestNode"\fP
T} T{
For each replica set in the sharded cluster (i.e. shard
replica set and config servers), the minimum size limit of
the \fBmongos\fP instance\(aqs connection pool to each
member of that replica set is equal to the largest among
the active connections counts to the primary and each
secondary members.
.sp
With \fB"matchBusiestNode"\fP, \fBmongos\fP maintains
enough connections to each secondary to handle the current
level of primary and secondary reads and writes. The number
of connections to maintain in the pool decreases as the
number of active connections decreases.
T}
_
T{
\fB"disabled"\fP
T} T{
For each replica set in the sharded cluster (i.e. shard
replica set and config servers), the minimum number of
connections in the \fBmongos\fP instance\(aqs
connection pool to each secondary is equal to the
\fI\%ShardingTaskExecutorPoolMinSize\fP\&.
T}
_
.TE
.sp
The following example sets the
\fI\%ShardingTaskExecutorPoolReplicaSetMatching\fP to
\fB"matchBusiestNode"\fP during startup:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter ShardingTaskExecutorPoolReplicaSetMatching="matchBusiestNode"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
During runtime, you can also set the parameter with the
\fBsetParameter\fP command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "matchBusiestNode" } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B taskExecutorPoolSize
Changed in version 4.0.
.sp
Type: integer
.sp
Default: 1
.sp
Available for \fBmongos\fP only.
.sp
The number of Task Executor connection pools to use for a given
\fBmongos\fP\&.
.sp
If the parameter value is \fB0\fP or less, the number of Task Executor
connection pools is the number of cores with the following
exceptions:
.INDENT 7.0
.IP \(bu 2
If the number of cores is less than 4, the number of Task Executor
connection pools is 4.
.IP \(bu 2
If the number of cores is greater than 64, the number of Task
Executor connection pools is 64.
.UNINDENT
.sp
Starting in MongoDB 4.0, the default value of
\fI\%taskExecutorPoolSize\fP is \fB1\fP:
.INDENT 7.0
.IP \(bu 2
In MongoDB 4.0 deployment, you can set
\fI\%taskExecutorPoolSize\fP to \fB0\fP and, on Linux, set
\fI\%AsyncRequestsSenderUseBaton\fP to
\fBfalse\fP for the previous behavior.
.IP \(bu 2
In MongoDB 4.2+ deployment, MongoDB removes the
\fBAsyncRequestsSenderUseBaton\fP parameter and always enables the
performance enhancement controlled by the parameter.
.UNINDENT
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongos \-\-setParameter taskExecutorPoolSize=6
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%ShardingTaskExecutorPoolMaxSize\fP
.IP \(bu 2
\fI\%ShardingTaskExecutorPoolMinSize\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B loadRoutingTableOnStartup
New in version 4.4.
.sp
Type: boolean
.sp
\fIDefault\fP: true
.sp
Available for \fBmongos\fP only.
.sp
Configures a \fBmongos\fP instance to preload the routing
table for a sharded cluster on startup. With this setting
enabled, the \fBmongos\fP caches the cluster\-wide routing
table for each sharded collection as part of its startup procedure,
before it begins accepting client connections.
.sp
Without this setting enabled, the \fBmongos\fP only loads
a routing table as needed for incoming client connections, and only
loads the specific routing table for the namespace of a given
request.
.sp
A \fBmongos\fP instance with the
\fI\%loadRoutingTableOnStartup\fP parameter enabled may
experience longer startup times, but will result in faster servicing
of initial client connections once started.
.sp
\fI\%loadRoutingTableOnStartup\fP is enabled by default.
.sp
You can only set this parameter on startup, using either the
\fBsetParameter\fP configuration file setting or the
\fB\-\-setParameter\fP command line option.
.UNINDENT
.INDENT 0.0
.TP
.B warmMinConnectionsInShardingTaskExecutorPoolOnStartup
New in version 4.4.
.sp
Type: boolean
.sp
\fIDefault\fP: true
.sp
Available for \fBmongos\fP only.
.sp
Configures a \fBmongos\fP instance to prewarm its connection
pool on startup. With this parameter enabled, the
\fBmongos\fP attempts to establish
\fI\%ShardingTaskExecutorPoolMinSize\fP network
connections to each shard server as part of its startup procedure,
before it begins accepting client connections.
.sp
A timeout for this behavior can be configured with the
\fI\%warmMinConnectionsInShardingTaskExecutorPoolOnStartupWaitMS\fP
parameter. If this timeout is reached, the \fBmongos\fP will
begin accepting client connections regardless of the size of its
connection pool.
.sp
A \fBmongos\fP instance with this parameter enabled may
experience longer startup times, but will result in faster servicing
of initial client connections once started.
.sp
\fI\%warmMinConnectionsInShardingTaskExecutorPoolOnStartup\fP is
enabled by default.
.sp
You can only set this parameter on startup, using either the
\fBsetParameter\fP configuration file setting or the
\fB\-\-setParameter\fP command line option.
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%warmMinConnectionsInShardingTaskExecutorPoolOnStartupWaitMS\fP
.IP \(bu 2
\fI\%ShardingTaskExecutorPoolMinSize\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B warmMinConnectionsInShardingTaskExecutorPoolOnStartupWaitMS
New in version 4.4.
.sp
Type: integer
.sp
\fIDefault\fP: 2000 (i.e. 2 seconds)
.sp
Available for \fBmongos\fP only.
.sp
Sets the timeout threshold in milliseconds for a
\fBmongos\fP to wait for \fI\%ShardingTaskExecutorPoolMinSize\fP
connections to be established per shard host when using the
\fI\%warmMinConnectionsInShardingTaskExecutorPoolOnStartup\fP
parameter. If this timeout is reached, the \fBmongos\fP will
begin accepting client connections regardless of the size of its
connection pool.
.sp
You can only set this parameter on startup, using either the
\fBsetParameter\fP configuration file setting or the
\fB\-\-setParameter\fP command line option.
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%warmMinConnectionsInShardingTaskExecutorPoolOnStartup\fP
.IP \(bu 2
\fI\%ShardingTaskExecutorPoolMinSize\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B migrateCloneInsertionBatchDelayMS
New in version 4.0.5: The parameter is also available starting in 3.4.18 and 3.6.10
.sp
Available for \fBmongod\fP only.
.sp
Type: Non\-negative integer
.sp
Default: 0
.sp
Time in milliseconds to wait between batches of insertions during
cloning step of the migration process. This wait is in addition to
the \fBsecondaryThrottle\fP\&.
.sp
The default value of \fB0\fP indicates no additional wait.
.sp
The following sets the \fI\%migrateCloneInsertionBatchDelayMS\fP to 200
milliseconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter migrateCloneInsertionBatchDelayMS=200
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The parameter may also be set using the \fBsetParameter\fP
command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, migrateCloneInsertionBatchDelayMS: 200 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B migrateCloneInsertionBatchSize
New in version 4.0.5: The parameter is also available starting in 3.4.18 and 3.6.10
.sp
Available for \fBmongod\fP only.
.sp
Type: Non\-negative integer
.sp
Default: 0
.sp
The maximum number of documents to insert in a single batch during
the cloning step of the migration process.
.sp
The default value of \fB0\fP indicates no maximum number of documents
per batch. However, in practice, this results in batches that
contain up to 16 MB of documents.
.sp
The following sets the \fI\%migrateCloneInsertionBatchSize\fP to 100
documents:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter migrateCloneInsertionBatchSize=100
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The parameter may also be set using the \fBsetParameter\fP
command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, migrateCloneInsertionBatchSize: 100 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B orphanCleanupDelaySecs
New in version 3.6.
.sp
Default: 900 (15 minutes)
.sp
Available for \fBmongod\fP only.
.sp
Minimum delay before a migrated chunk is deleted from the source
shard.
.sp
Before deleting the chunk during chunk migration, MongoDB waits for
\fI\%orphanCleanupDelaySecs\fP or for in\-progress queries involving
the chunk to complete on the shard primary, whichever is longer.
.sp
However, because the shard primary has no knowledge of in\-progress queries
run on the shard secondaries, queries that use the chunk but are run on
secondaries may see documents disappear if these queries take longer than
the time to complete the shard primary queries and the
\fI\%orphanCleanupDelaySecs\fP\&.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
This behavior only affects in\-progress queries that start before the
chunk migration. Queries that start after the chunk migration starts
will not use the migrating chunk.
.UNINDENT
.UNINDENT
.sp
If a shard has storage constraints, consider reducing this value
temporarily. If running queries that exceed 15 minutes on shard
secondaries, consider increasing this value.
.sp
The following sets the \fI\%orphanCleanupDelaySecs\fP to 20 minutes:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter orphanCleanupDelaySecs=1200
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
This may also be set using the \fBsetParameter\fP command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, orphanCleanupDelaySecs: 1200 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B rangeDeleterBatchDelayMS
New in version 4.0.1: The parameter is also available starting in 3.4.17 and 3.6.7.
.sp
Available for \fBmongod\fP only.
.sp
Type: Non\-negative integer
.sp
Default: 20
.sp
The amount of time in milliseconds to wait before the next batch of
deletion during the cleanup stage of chunk migration (or the \fBcleanupOrphaned\fP
command).
.sp
In MongoDB 3.4, consider whether _secondaryThrottle is set before modifying the
\fI\%rangeDeleterBatchDelayMS\fP\&. In MongoDB 3.4, the
_secondaryThrottle replication delay occurs after each document deletion
instead of after the batch deletion.
.sp
In MongoDB 3.6+, the _secondaryThrottle replication delay occurs after each batch deletion.
.sp
The following sets the \fI\%rangeDeleterBatchDelayMS\fP to 200
milliseconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter rangeDeleterBatchDelayMS=200
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The parameter may also be set using the \fBsetParameter\fP
command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, rangeDeleterBatchDelayMS: 200 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B rangeDeleterBatchSize
New in version 4.0.5: The parameter is also available starting in 3.4.19 and 3.6.10
.sp
Available for \fBmongod\fP only.
.sp
Type: Non\-negative integer
.sp
Default: 0
.sp
The maximum number of documents in each batch to delete during the
cleanup stage of chunk migration
(or the \fBcleanupOrphaned\fP command).
.sp
The default value of \fB0\fP indicates that the system chooses an
appropriate value, generally 128 documents.
.sp
The following sets the \fI\%rangeDeleterBatchSize\fP to 100
documents:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter rangeDeleterBatchSize=100
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The parameter may also be set using the \fBsetParameter\fP
command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, rangeDeleterBatchSize: 100 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B skipShardingConfigurationChecks
New in version 3.6.3.
.sp
Available for \fBmongod\fP only.
.sp
Type: boolean
.sp
Default: false
.sp
When \fBtrue\fP, allows for starting a shard member or config server
member as a standalone for maintenance operations. This parameter is
mutually exclusive with the \fB\-\-configsvr\fP or \fB\-\-shardsvr\fP options.
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter skipShardingConfigurationChecks=true
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBIMPORTANT:\fP
.INDENT 7.0
.INDENT 3.5
Once maintenance has completed, remove the
\fI\%skipShardingConfigurationChecks\fP parameter when
restarting the \fBmongod\fP\&.
.UNINDENT
.UNINDENT
.sp
The parameter is also available for MongoDB versions:
.INDENT 7.0
.IP \(bu 2
MongoDB 3.2.19+
.IP \(bu 2
MongoDB 3.4.11+
.UNINDENT
.UNINDENT
.SS Storage Parameters
.INDENT 0.0
.TP
.B journalCommitInterval
Available for \fBmongod\fP only.
.sp
Specify an integer between \fB1\fP and \fB500\fP signifying the number
of milliseconds (ms) between journal commits.
.sp
Consider the following example which sets the
\fI\%journalCommitInterval\fP to \fB200\fP ms:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, journalCommitInterval: 200 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fBstorage.journal.commitIntervalMs\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B syncdelay
Available for \fBmongod\fP only.
.sp
Specify the interval in seconds between fsync operations
where \fBmongod\fP flushes its working memory to disk. By
default, \fBmongod\fP flushes memory to disk every 60
seconds. In almost every situation you should not set this value
and use the default setting.
.sp
Consider the following example which sets the \fBsyncdelay\fP to
\fB60\fP seconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, syncdelay: 60 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%journalCommitInterval\fP
.IP \(bu 2
\fBstorage.syncPeriodSecs\fP
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B honorSystemUmask
New in version 3.6.
.sp
\fIDefault\fP: \fBfalse\fP
.sp
If \fI\%honorSystemUmask\fP is set to \fBtrue\fP, new files
created by MongoDB have permissions in accordance with the
user\(aqs \fBumask\fP settings.
.sp
If \fI\%honorSystemUmask\fP is set to \fBfalse\fP, new files
created by MongoDB have permissions set to \fB600\fP, which gives
read and write permissions only to the owner. New directories have
permissions set to \fB700\fP\&.
.sp
You can only set this parameter during start\-up and cannot change
this setting using the \fBsetParameter\fP database command.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter honorSystemUmask=true
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
\fI\%honorSystemUmask\fP is not available on Windows systems.
.UNINDENT
.UNINDENT
.UNINDENT
.SS WiredTiger Parameters
.INDENT 0.0
.TP
.B wiredTigerMaxCacheOverflowSizeGB
.INDENT 7.0
.INDENT 3.5
.IP "Deprecated in MongoDB 4.4"
.sp
MongoDB deprecates the \fBwiredTigerMaxCacheOverflowSizeGB\fP
parameter. The parameter has no effect starting in MongoDB 4.4.
.UNINDENT
.UNINDENT
.sp
\fIDefault\fP: 0 (No specified maximum)
.sp
Available for \fBmongod\fP only.
.sp
Specify the maximum size (in GB) for the "lookaside (or cache
overflow) table" file \fBWiredTigerLAS.wt\fP for MongoDB
4.2.1\-4.2.x and 4.0.12\-4.0.x. The file no longer exists starting in
version 4.4.
.sp
The parameter can accept the following values:
.TS
center;
|l|l|.
_
T{
Value
T} T{
Description
T}
_
T{
\fB0\fP
T} T{
The default value. If set to \fB0\fP, the file size is
unbounded.
T}
_
T{
number >= 0.1
T} T{
The maximum size (in GB). If the \fBWiredTigerLAS.wt\fP
file exceeds this size, \fBmongod\fP exits with a
fatal assertion. You can clear the \fBWiredTigerLAS.wt\fP
file and restart \fBmongod\fP\&.
T}
_
.TE
.sp
You can only set this parameter during runtime using the
\fBsetParameter\fP database command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, wiredTigerMaxCacheOverflowSizeGB: 100 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
To set the maximum size during start up, use the
\fBstorage.wiredTiger.engineConfig.maxCacheOverflowFileSizeGB\fP
instead.
.sp
\fIAvailable starting in MongoDB 4.2.1 (and 4.0.12)\fP
.UNINDENT
.INDENT 0.0
.TP
.B wiredTigerConcurrentReadTransactions
Available for \fBmongod\fP only.
.sp
Available for the WiredTiger storage engine only.
.sp
Specify the maximum number of concurrent read transactions allowed
into the WiredTiger storage engine.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, wiredTigerConcurrentReadTransactions: <num> } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fBwiredTiger.concurrentTransactions\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B wiredTigerConcurrentWriteTransactions
Available for \fBmongod\fP only.
.sp
Available for the WiredTiger storage engine only.
.sp
Specify the maximum number of concurrent write transactions allowed
into the WiredTiger storage engine.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, wiredTigerConcurrentWriteTransactions: <num> } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
\fBwiredTiger.concurrentTransactions\fP
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B wiredTigerEngineRuntimeConfig
Available for \fBmongod\fP only.
.sp
Specify \fBwiredTiger\fP storage engine configuration options for a
running \fBmongod\fP instance. You can \fIonly\fP set this
parameter using the \fBsetParameter\fP command and \fInot\fP
using the command line or configuration file option.
.sp
\fBWARNING:\fP
.INDENT 7.0
.INDENT 3.5
Avoid modifying the \fI\%wiredTigerEngineRuntimeConfig\fP
unless under the direction from MongoDB engineers as this setting has
major implication across both WiredTiger and MongoDB.
.UNINDENT
.UNINDENT
.sp
Consider the following operation prototype:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand({
"setParameter": 1,
"wiredTigerEngineRuntimeConfig": "<option>=<setting>,<option>=<setting>"
})
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
See the WiredTiger documentation for all available \fI\%WiredTiger
configuration options\fP\&.
.UNINDENT
.SS Auditing Parameters
.INDENT 0.0
.TP
.B auditAuthorizationSuccess
\fIDefault\fP: \fBfalse\fP
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Available only in \fI\%MongoDB Enterprise\fP
and \fI\%MongoDB Atlas\fP\&.
.UNINDENT
.UNINDENT
.sp
Available for both \fBmongod\fP and \fBmongos\fP\&.
.sp
Enables the auditing of authorization
successes for the authCheck
action.
.sp
When \fI\%auditAuthorizationSuccess\fP is \fBfalse\fP, the
audit system only logs the authorization
failures for \fBauthCheck\fP\&.
.sp
To enable the audit of authorization successes, issue the following
command:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, auditAuthorizationSuccess: true } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Enabling \fI\%auditAuthorizationSuccess\fP degrades performance
more than logging only the authorization failures.
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 0.0
.INDENT 3.5
\fBgetParameter\fP
.UNINDENT
.UNINDENT
.SS Transaction Parameters
.INDENT 0.0
.TP
.B transactionLifetimeLimitSeconds
New in version 4.0.
.sp
Available for \fBmongod\fP only.
.sp
\fIDefault\fP: 60
.sp
Specifies the lifetime of multi\-document transactions\&. Transactions that exceeds this limit are
considered expired and will be aborted by a periodic cleanup
process. The cleanup process runs every
\fI\%transactionLifetimeLimitSeconds\fP/2 seconds or at least
once per every 60 seconds.
.sp
The cleanup process helps relieve storage cache pressure.
.sp
The minimum value for transactionLifetimeLimitSeconds is \fB1\fP
second.
.sp
The following sets the
\fI\%transactionLifetimeLimitSeconds\fP to \fB30\fP
seconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, transactionLifetimeLimitSeconds: 30 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can also set parameter \fI\%transactionLifetimeLimitSeconds\fP at
startup time.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter "transactionLifetimeLimitSeconds=30"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
To set the parameter for a sharded cluster, the parameter must be
modified for all shard replica set members.
.UNINDENT
.INDENT 0.0
.TP
.B maxTransactionLockRequestTimeoutMillis
New in version 4.0.
.sp
Available for \fBmongod\fP only.
.sp
\fIType\fP: integer
.sp
\fIDefault\fP: 5
.sp
The maximum amount of time in milliseconds that multi\-document
transactions should wait to acquire locks
required by the operations in the transaction.
.sp
If the transaction cannot acquire the locks after waiting
\fI\%maxTransactionLockRequestTimeoutMillis\fP, the transaction
aborts.
.sp
By default, multi\-document transactions
wait \fB5\fP milliseconds. That is, if the transaction cannot acquire
the locks within \fB5\fP milliseconds, the transaction aborts. If an
operation provides a greater timeout in a lock request,
\fI\%maxTransactionLockRequestTimeoutMillis\fP overrides the
operation\-specific timeout.
.sp
You can set \fI\%maxTransactionLockRequestTimeoutMillis\fP to:
.INDENT 7.0
.IP \(bu 2
\fB0\fP such that if the transaction cannot acquire the required
locks immediately, the transaction aborts.
.IP \(bu 2
A number greater than \fB0\fP to wait the specified time to acquire
the required locks. This can help obviate transaction aborts on
momentary concurrent lock acquisitions, like fast\-running metadata
operations. However, this could possibly delay the abort of
deadlocked transaction operations.
.IP \(bu 2
\fB\-1\fP to use the operation specific timeout.
.UNINDENT
.sp
The following sets the
\fI\%maxTransactionLockRequestTimeoutMillis\fP to \fB20\fP
milliseconds:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand( { setParameter: 1, maxTransactionLockRequestTimeoutMillis: 20 } )
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
You can also set this parameter during start\-up:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
mongod \-\-setParameter maxTransactionLockRequestTimeoutMillis=20
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SH AUTHOR
MongoDB Documentation Project
.SH COPYRIGHT
2008-2020
.\" Generated by docutils manpage writer.
.