.TH mongodb-parameters 5 .SH MONGODB SERVER PARAMETERS .SH SYNOPSIS MongoDB provides a number of configuration options that you can set using: .RS .IP \(bu 2 the \fBsetParameter\f1\f1 command: .IP .EX db.adminCommand( { setParameter: 1, : } ) .EE .IP \(bu 2 the \fBsetParameter\f1\f1 configuration setting: .IP .EX setParameter: : ... .EE .IP \(bu 2 the \fB\-\-setParameter\f1 command\-line option for \fBmongod\f1\f1 and \fBmongos\f1\f1: .IP .EX mongod \-\-setParameter = mongos \-\-setParameter = .EE .RE .PP For additional configuration options, see \fBConfiguration File Options\f1, \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .SH PARAMETERS .SS AUTHENTICATION PARAMETERS .PP \fBauthenticationMechanisms\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP 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 \fBAuthentication\f1\&. .RS .IP \(bu 2 .RS .IP \(bu 4 Value .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 \fBSCRAM\-SHA\-1\f1 .IP \(bu 4 RFC 5802 (https://tools.ietf.org/html/rfc5802) standard Salted Challenge Response Authentication Mechanism using the SHA\-1 hash function. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBSCRAM\-SHA\-256\f1 .IP \(bu 4 RFC 7677 (https://tools.ietf.org/html/rfc7677) standard Salted Challenge Response Authentication Mechanism using the SHA\-256 hash function. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBMONGODB\-X509\f1 .IP \(bu 4 MongoDB TLS/SSL certificate authentication. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBGSSAPI\f1 (Kerberos) .IP \(bu 4 External authentication using Kerberos. This mechanism is available only in MongoDB Enterprise (http://www.mongodb.com/products/mongodb\-enterprise\-advanced?tck=docs_server)\&. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBPLAIN\f1 (LDAP SASL) .IP \(bu 4 External authentication using LDAP. You can also use \fBPLAIN\f1 for authenticating in\-database users. \fBPLAIN\f1 transmits passwords in plain text. This mechanism is available only in MongoDB Enterprise (http://www.mongodb.com/products/mongodb\-enterprise\-advanced?tck=docs_server)\&. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBMONGODB\-OIDC\f1 .IP \(bu 4 OpenID Connect is an authentication layer built on top of OAuth2. This mechanism is available only in MongoDB Enterprise (http://www.mongodb.com/products/mongodb\-enterprise\-advanced?tck=docs_server)\&. .RE .RE .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to specify both \fBPLAIN\f1 and \fBSCRAM\-SHA\-256\f1 as the authentication mechanisms, use the following command: .PP .EX mongod \-\-setParameter authenticationMechanisms=PLAIN,SCRAM\-SHA\-256 \-\-auth .EE .RE .PP \fBawsSTSRetryCount\f1 .RS .PP In previous versions, AWS IAM authentication retried only when the server returned an HTTP 500 error. .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 2 .PP For MongoDB deployments using AWS IAM credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access\-keys.html) or AWS IAM environment variables (https://docs.aws.amazon.com/cli/latest/userguide/cli\-configure\-envvars.html#envvars\-list)\&. .PP Maximum number of AWS IAM authentication retries after a connection failure. .PP The following example sets \fBawsSTSRetryCount\f1\f1 to \fB15\f1 retries: .PP .EX mongod \-\-setParameter awsSTSRetryCount=15 .EE .PP Alternatively, the following examples uses the \fBsetParameter\f1\f1 command within \fBmongosh\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, awsSTSRetryCount: 15 } ) .EE .RE .PP \fBclusterAuthMode\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Set the \fBclusterAuthMode\f1\f1 to either \fBsendX509\f1 or \fBx509\f1\&. Useful during \fBrolling upgrade to use x509 for membership authentication\f1 to minimize downtime. .PP For more information about TLS/SSL and MongoDB, see \fBConfigure mongod\f1 and mongos\f1 for TLS/SSL\f1 and \fBTLS/SSL Configuration for Clients\f1 . .PP This parameter is only available at runtime. To set the parameter, use the \fBsetParameter\f1\f1 command. .PP .EX db.adminCommand( { setParameter: 1, clusterAuthMode: "sendX509" } ) .EE .RE .PP \fBenableLocalhostAuthBypass\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: \fBtrue\f1 .PP Specify \fB0\f1 or \fBfalse\f1 to disable localhost authentication bypass. Enabled by default. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP See \fBLocalhost Exception\f1 for more information. .RE .PP \fBenforceUserClusterSeparation\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Set to \fBfalse\f1 to disable the \fBO/OU/DC\f1 check when \fBclusterAuthMode\f1 is \fBkeyFile\f1 in your configuration file. This allows clients possessing member certificates to authenticate as users stored in the \fB$external\f1 database. The server won\(aqt start if \fBclusterAuthMode\f1 isn\(aqt \fBkeyFile\f1 in your configuration file. .PP To set the \fBenforceUserClusterSeparation\f1 parameter to \fBfalse\f1, run the following command during startup: .PP .EX mongod \-\-setParameter enforceUserClusterSeparation=false .EE .PP If you set the \fBenforceUserClusterSeparation\f1 parameter to \fBfalse\f1, the server doesn\(aqt distinguish between client certificates, which applications use to authenticate, and intra\-cluster certificates, which have privileged access. This has no effect if your \fBclusterAuthMode\f1 is \fBkeyFile\f1\&. However, if your \fBclusterAuthMode\f1 is \fBx509\f1, user certificates that use the allowed scheme are conflated with cluster certificates and granted privileged access. .PP Your existing certificates are granted internal privileges if you do the following: .RS .IP \(bu 2 Create a user, with a name allowed by this parameter. .IP \(bu 2 Set the \fBenforceUserClusterSeparation\f1 parameter to \fBfalse\f1\&. .IP \(bu 2 Set \fBclusterAuthMode\f1 to \fBx509\f1\&. .RE .PP You must not upgrade from \fBkeyFile\f1 to \fBx509\f1 without validating that you\(aqve removed users with elevated privileges that the \fBenforceUserClusterSeparation\f1 flag allowed you to create. .RE .PP \fBKeysRotationIntervalSec\f1 .RS .PP \fIDefault\f1: 7776000 seconds (90 days) .PP Specifies the number of seconds for which an HMAC signing key (https://en.wikipedia.org/wiki/Hash\-based_message_authentication_code) is valid before rotating to the next one. This parameter is intended primarily to facilitate authentication testing. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBldapForceMultiThreadMode\f1 .RS .PP \fIDefault\f1: false .PP Enables the performance of concurrent LDAP operations. .PP Only if you are certain that your instance of \fBlibldap\f1 is safe to use in this mode, enable this flag. You may experience crashes of the MongoDB process if the \fBlibldap\f1 version you are using is not thread safe. .PP You must use \fBldapForceMultiThreadMode\f1\f1 to use LDAP connection pool. To enable LDAP connection pool, set \fBldapForceMultiThreadMode\f1\f1 and \fBldapUseConnectionPool\f1\f1 to \fBtrue\f1\&. .PP If you have any concerns regarding your MongoDB version, OS version or libldap version, please contact MongoDB Support. .RE .PP \fBldapQueryPassword\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: string .PP The password used to bind to an LDAP server. You must use \fBldapQueryUser\f1\f1 with this parameter. .PP If not set, mongod or mongos does not attempt to bind to the LDAP server. .RE .PP \fBldapQueryUser\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: string .PP The user that binds to an LDAP server. You must use \fBldapQueryPassword\f1\f1 with this parameter. .PP If not set, mongod or mongos does not attempt to bind to the LDAP server. .RE .PP \fBldapRetryCount\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 0 .PP For MongoDB deployments using \fBLDAP Authorization\f1\&. .PP Number of operation retries by the server LDAP manager after a network error. .PP For example, the following sets \fBldapRetryCount\f1\f1 to \fB3\f1 seconds: .PP .EX mongod \-\-ldapRetryCount=3 .EE .PP Or, if using the \fBsetParameter\f1\f1 command within \fBmongosh\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, ldapRetryCount: 3 } ) .EE .RE .PP \fBldapUserCacheInvalidationInterval\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Starting in MongoDB 5.2, the update interval for cached user information retrieved from an LDAP server depends on \fBldapShouldRefreshUserCacheEntries\f1\f1: .RS .IP \(bu 2 If true, use \fBldapUserCacheRefreshInterval\f1\f1\&. .IP \(bu 2 If false, use \fBldapUserCacheInvalidationInterval\f1\f1\&. .RE .PP For use with MongoDB deployments using \fBLDAP Authorization\f1\&. .PP The interval (in seconds) that the \fBmongod\f1\f1 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. .PP 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. .PP Defaults to 30 seconds. .RE .PP \fBldapUserCacheRefreshInterval\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 30 seconds .PP Starting in MongoDB 5.2, the update interval for cached user information retrieved from an LDAP server depends on \fBldapShouldRefreshUserCacheEntries\f1\f1: .RS .IP \(bu 2 If true, use \fBldapUserCacheRefreshInterval\f1\f1\&. .IP \(bu 2 If false, use \fBldapUserCacheInvalidationInterval\f1\f1\&. .RE .PP For MongoDB deployments using \fBLDAP Authorization\f1\&. .PP The interval in seconds that \fBmongod\f1\f1 waits before refreshing the cached user information from the LDAP server. .PP The maximum interval is 86,400 seconds (24 hours). .PP For example, the following sets \fBldapUserCacheRefreshInterval\f1\f1 to \fB4000\f1 seconds: .PP .EX mongod \-\-setParameter ldapUserCacheRefreshInterval=4000 .EE .PP Or, if using the \fBsetParameter\f1\f1 command within \fBmongosh\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, ldapUserCacheRefreshInterval: 4000 } ) .EE .RE .PP \fBldapUserCacheStalenessInterval\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 90 seconds .PP For MongoDB deployments using \fBLDAP Authorization\f1\&. .PP The interval in seconds that \fBmongod\f1\f1 retains the cached LDAP user information after the last cache refresh. .PP If more than \fBldapUserCacheStalenessInterval\f1\f1 seconds elapse without a successful refresh of the user information from the LDAP server, then \fBmongod\f1\f1: .RS .IP \(bu 2 Invalidates the cached LDAP user information. .IP \(bu 2 Is unable to authenticate new sessions for LDAP users until \fBmongod\f1\f1 connects to the LDAP server and authorizes the LDAP user. .IP \(bu 2 Authorizes any existing sessions that use previously authenticated LDAP users if \fBmongod\f1\f1 is unable to connect to the LDAP server. When \fBmongod\f1\f1 reconnects to the LDAP server, \fBmongod\f1\f1 ensures the LDAP users are correctly authorized. .RE .PP The maximum interval is 86,400 seconds (24 hours). .PP For example, the following sets \fBldapUserCacheStalenessInterval\f1\f1 to \fB4000\f1 seconds: .PP .EX mongod \-\-setParameter ldapUserCacheStalenessInterval=4000 .EE .PP Or, if using the \fBsetParameter\f1\f1 command within \fBmongosh\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, ldapUserCacheStalenessInterval: 4000 } ) .EE .RE .PP \fBldapUseConnectionPool\f1 .RS .PP Specifies whether MongoDB should use connection pooling when connecting to the LDAP server for authentication/authorization. .PP MongoDB uses the following default values: .RS .IP \(bu 2 true on Windows. .IP \(bu 2 true on Linux where MongoDB Enterprise binaries are linked against \fBlibldap_r\f1\&. .IP \(bu 2 false on Linux where MongoDB Enterprise binaries are linked against \fBlibldap\f1\&. .RE .PP You can only set \fBldapUseConnectionPool\f1\f1 during start\-up, and cannot change this setting with the \fBsetParameter\f1\f1 database command. .RE .PP \fBldapConnectionPoolUseLatencyForHostPriority\f1 .RS .PP \fIDefault\f1: true .PP A boolean that determines whether the LDAP connection pool (see \fBldapUseConnectionPool\f1\f1) should use latency of the LDAP servers to determine the connection order (from lowest latency to highest). .PP You can only set \fBldapConnectionPoolUseLatencyForHostPriority\f1\f1 during start\-up, and cannot change this setting during run time with the \fBsetParameter\f1\f1 database command. .RE .PP \fBldapConnectionPoolMinimumConnectionsPerHost\f1 .RS .PP \fIDefault\f1: 1 .PP The minimum number of connections to keep open to each LDAP server. .PP You can only set \fBldapConnectionPoolMinimumConnectionsPerHost\f1\f1 during start\-up, and cannot change this setting during run time with the \fBsetParameter\f1\f1 database command. .RE .PP \fBldapConnectionPoolMaximumConnectionsPerHost\f1 .RS .PP \fIChanged starting in MongoDB versions 5.0.9 and 6.0.0\f1 Changed default value to \fB2147483647\f1\&. In previous versions, the default is unset. .PP \fIDefault\f1: 2147483647 .PP The maximum number of connections to keep open to each LDAP server. .PP You can only set \fBldapConnectionPoolMaximumConnectionsPerHost\f1\f1 during start\-up, and cannot change this setting during run time with the \fBsetParameter\f1\f1 database command. .RE .PP \fBldapConnectionPoolMaximumConnectionsInProgressPerHost\f1 .RS .PP \fIChanged starting in MongoDB versions 5.0.9 and 6.0.0\f1 Changed default value to \fB2\f1\&. In previous versions, the default is unset. .PP \fIDefault\f1: 2 .PP The maximum number of in\-progress connect operations to each LDAP server. .PP You can only set \fBldapConnectionPoolMaximumConnectionsInProgressPerHost\f1\f1 during start\-up, and cannot change this setting with the \fBsetParameter\f1\f1 database command. .RE .PP \fBldapConnectionPoolHostRefreshIntervalMillis\f1 .RS .PP \fIDefault\f1: 60000 .PP The number of milliseconds in\-between health checks of the pooled LDAP connections. .PP You can only set \fBldapConnectionPoolHostRefreshIntervalMillis\f1\f1 during start\-up, and cannot change this setting with the \fBsetParameter\f1\f1 database command. .RE .PP \fBldapConnectionPoolIdleHostTimeoutSecs\f1 .RS .PP \fIDefault\f1: 300 .PP The maximum number of seconds that the pooled connections to an LDAP server can remain idle before being closed. .PP You can only set \fBldapConnectionPoolIdleHostTimeoutSecs\f1\f1 during start\-up, and cannot change this setting with the \fBsetParameter\f1\f1 database command. .RE .PP \fBldapShouldRefreshUserCacheEntries\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP For MongoDB deployments using \fBLDAP Authorization\f1\&. .PP Starting in MongoDB 5.2, the update interval for cached user information retrieved from an LDAP server depends on \fBldapShouldRefreshUserCacheEntries\f1\f1: .RS .IP \(bu 2 If true, use \fBldapUserCacheRefreshInterval\f1\f1\&. .IP \(bu 2 If false, use \fBldapUserCacheInvalidationInterval\f1\f1\&. .RE .PP You can only set \fBldapShouldRefreshUserCacheEntries\f1\f1 during startup in the \fBconfiguration file\f1\f1 or with the \fB\-\-setParameter\f1 option on the command line. For example, the following disables \fBldapShouldRefreshUserCacheEntries\f1\f1: .PP .EX mongod \-\-setParameter ldapShouldRefreshUserCacheEntries=false .EE .RE .PP \fBmaxValidateMemoryUsageMB\f1 .RS .PP \fIDefault\f1: 200 .PP The maximum memory usage limit in megabytes for the \fBvalidate\f1\f1 command. If the limit is exceeded, \fBvalidate\f1\f1 returns as many results as possible and warns that not all corruption might be reported because of the limit. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBoidcIdentityProviders\f1 .RS .PP Use this parameter to specify identity provider (IDP) configurations when using \fBOpenID Connect Authentication\f1\&. .PP \fBoidcIdentityProviders\f1 accepts an array of zero or more identity provider (IDP) configurations. An empty array (default) indicates no OpenID Connect support is enabled. When more than one IDP is defined, \fBoidcIdentityProviders\f1 uses the \fBmatchPattern\f1 field to select an IDP. Array order determines the priority and the first IDP is always selected. .SS OIDCIDENTITYPROVIDERS FIELDS .RS .IP \(bu 2 .RS .IP \(bu 4 Field .IP \(bu 4 Necessity .IP \(bu 4 Type .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 \fBissuer\f1 .IP \(bu 4 Required .IP \(bu 4 string .IP \(bu 4 The issuer URI of the IDP that the server should accept tokens from. This must match the \fBiss\f1 field in any JWT used for authentication. .IP If you specify an unreachable issuer URI, MongoDB: .RS .IP \(bu 6 Logs a warning. .IP \(bu 6 Continues server startup, which allows you to update the issuer URI. .IP \(bu 6 Reattempts issuer contact. If MongoDB reaches the issuer URI and validates the access token, authentication succeeds. If the issuer URI remains unreachable, authentication fails. .RE .RE .IP \(bu 2 .RS .IP \(bu 4 \fBauthNamePrefix\f1 .IP \(bu 4 Required .IP \(bu 4 string .IP \(bu 4 Unique prefix applied to each generated \fBUserName\f1 and \fBRoleName\f1 used in authorization. \fBauthNamePrefix\f1 can only contain the following characters: .RS .IP \(bu 6 alphanumeric characters (combination of \fBa\f1 to \fBz\f1 and \fB0\f1 to \fB9\f1) .IP \(bu 6 hyphens (\fB\-\f1) .IP \(bu 6 underscores (\fB_\f1) .RE .RE .IP \(bu 2 .RS .IP \(bu 4 \fBmatchPattern\f1 .IP \(bu 4 Conditional .IP \(bu 4 string .IP \(bu 4 Regex pattern used to determine which IDP should be used. \fBmatchPattern\f1 matches against usernames. Array order determines the priority and the first IDP is always selected. .IP \fBmatchPattern\f1 is required in some configurations, depending on how the user sets \fBsupportsHumanFlows\f1: .RS .IP \(bu 6 When only one IdP has \fBsupportsHumanFlows\f1 set to \fBtrue\f1 (the default), \fBmatchPatterns\f1 is optional. .IP \(bu 6 When multiple IdP\(aqs have \fBsupportsHumanFlows\f1 set to \fBtrue\f1 (the default), each of these requires \fBmatchPatterns\f1\&. .IP \(bu 6 \fBmatchPatterns\f1 is optional for any IdP where \fBsupportsHumanFlows\f1 is set to \fBfalse\f1\&. .RE .IP This is not a security mechanism. \fBmatchPattern\f1 serves only as an advisory to clients. MongoDB accepts tokens issued by the IDP whose principal names do not match this pattern. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBclientId\f1 .IP \(bu 4 Conditional .IP \(bu 4 string .IP \(bu 4 ID provided by the IDP to identify the client that receives the access tokens. .IP Required when \fBsupportsHumanFlows\f1 is set to \fBtrue\f1 (the default). .RE .IP \(bu 2 .RS .IP \(bu 4 \fBaudience\f1 .IP \(bu 4 Required .IP \(bu 4 string .IP \(bu 4 Specifies the application or service that the access token is intended for. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBrequestScopes\f1 .IP \(bu 4 Optional .IP \(bu 4 array[ string ] .IP \(bu 4 Permissions and access levels that MongoDB requests from the IDP. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBprincipalName\f1 .IP \(bu 4 Optional .IP \(bu 4 string .IP \(bu 4 The claim to be extracted from the access token containing MongoDB user identifiers. .IP The default value is \fBsub\f1 (stands for \fBsubject\f1). .RE .IP \(bu 2 .RS .IP \(bu 4 \fBuseAuthorizationClaim\f1 .IP \(bu 4 Optional .IP \(bu 4 boolean .IP \(bu 4 Determines if the \fBauthorizationClaim\f1 is required. The default value is \fBtrue\f1\&. .IP If the \fBuseAuthorizationClaim\f1 field is set to \fBtrue\f1, the server requires an \fBauthorizationClaim\f1 for the identity provider\(aqs config. This is the default behavior. .IP If the \fBuseAuthorizationClaim\f1 field is set to \fBfalse\f1, the \fBauthorizationClaim\f1 field is optional (and ignored if provided). Instead, the server does the following: .RS .IP \(bu 6 Searches the token for a claim whose name is listed in the \fBprincipalNameClaim\f1 field. This is typically named \fBsub\f1\&. For example: .IP \fBsub: "spencer.jackson@example.com"\f1 .IP \(bu 6 Constructs the internal username by concatenating the \fBauthNamePrefix\f1, a forward slash (\fB/\f1), and the contents of the claim identified by \fBprincipalNameClaim\f1 within the access token. For example, with a \fBauthNamePrefix\f1 field value of "mdbinc", the internal username is: .IP \fBmdbinc/spencer.jackson@example.com\f1 .IP \(bu 6 Looks for the user with this username and authorizes the client with the roles: .IP .EX { user: "mdbinc/spencer.jackson@example.com", db: "$external" } .EE .RE .RE .IP \(bu 2 .RS .IP \(bu 4 \fBauthorizationClaim\f1 .IP \(bu 4 Conditional .IP \(bu 4 string .IP \(bu 4 Required, unless \fBuseAuthorizationClaim\f1 is set to \fBfalse\f1\&. .IP Claim extracted from access token that contains MongoDB role names. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBlogClaims\f1 .IP \(bu 4 Optional .IP \(bu 4 array[ string ] .IP \(bu 4 List of access token claims to include in log and audit messages upon authentication completion. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBJWKSPollSecs\f1 .IP \(bu 4 Optional .IP \(bu 4 integer .IP \(bu 4 Frequency, in seconds, to request an updated JSON Web Key Set (JWKS) from the IDP. A setting of 0 disables polling. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBsupportsHumanFlows\f1 .IP \(bu 4 Optional .IP \(bu 4 bool .IP \(bu 4 Whether the OIDC provider supports human or machine workflows. This affects the \fBclientId\f1 and \fBmatchPattern\f1 fields. .IP You may find it useful to set this field to \fBfalse\f1 with machine workload IdP\(aqs to allow them to omit the \fBclientId\f1 when it\(aqs unneeded. .IP Default: \fBtrue\f1\&. .RE .RE .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBocspEnabled\f1 .RS .PP Available on Linux and macOS. .PP \fIDefault\f1: true .PP The flag that enables or disables OCSP. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, the following disables OCSP: .PP .EX mongod \-\-setParameter ocspEnabled=false ... .EE .PP Starting in MongoDB 6.0, if \fBocspEnabled\f1\f1 is set to \fBtrue\f1 during initial sync, all nodes must be able to reach the \fBOCSP\f1 responder. .PP If a member fails in the \fBSTARTUP2\f1\f1 state, set \fBtlsOCSPVerifyTimeoutSecs\f1\f1 to a value that is less than \fB5\f1\&. .RS .IP \(bu 2 \fBocspValidationRefreshPeriodSecs\f1\f1 .IP \(bu 2 \fBtlsOCSPStaplingTimeoutSecs\f1\f1 .IP \(bu 2 \fBtlsOCSPVerifyTimeoutSecs\f1\f1 .RE .RE .PP \fBocspValidationRefreshPeriodSecs\f1 .RS .PP Available on Linux. .PP The number of seconds to wait before refreshing the stapled OCSP status response. Specify a number greater than or equal to 1. .PP You can only set \fBocspValidationRefreshPeriodSecs\f1\f1 during startup in the \fBconfiguration file\f1\f1 or with the \fB\-\-setParameter\f1 option on the command line. For example, the following sets the parameter to 3600 seconds: .PP .EX mongod \-\-setParameter ocspValidationRefreshPeriodSecs=3600 ... .EE .PP Starting in MongoDB 5.0, the \fBrotateCertificates\f1\f1 command and \fBdb.rotateCertificates()\f1\f1 method will also refresh any stapled OCSP responses. .RS .IP \(bu 2 \fBocspEnabled\f1\f1 .IP \(bu 2 \fBtlsOCSPStaplingTimeoutSecs\f1\f1 .IP \(bu 2 \fBtlsOCSPVerifyTimeoutSecs\f1\f1 .RE .RE .PP \fBopensslCipherConfig\f1 .RS .PP \fIAvailable on Linux only\f1 .PP With the use of native TLS/SSL libraries, the parameter \fBopensslCipherConfig\f1\f1 is supported for Linux/BSD and no longer supported in Windows and macOS. .PP Specify the cipher string for OpenSSL when using TLS/SSL encryption. For a list of cipher strings, see https://www.openssl.org/docs/man1.1.1/man1/ciphers.html (https://www.openssl.org/docs/man1.1.1/man1/ciphers.html)\&. Multiple cipher strings can be provided as a colon\-separated list. .PP This parameter is only for use with TLS 1.2 or earlier. To specify cipher suites for use with TLS 1.3, use the \fBopensslCipherSuiteConfig\f1\f1 parameter. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP The use of \fBTLS\f1 options is preferred over \fBSSL\f1 options. The TLS options have the same functionality as the \fBSSL\f1 options. The following example configures a \fBmongod\f1\f1 with a \fBopensslCipherConfig\f1\f1 cipher string of \fB\(aqHIGH:!EXPORT:!aNULL@STRENGTH\(aq\f1: .PP .EX mongod \-\-setParameter opensslCipherConfig=\(aqHIGH:!EXPORT:!aNULL@STRENGTH\(aq \-\-tlsMode requireTLS \-\-tlsCertificateKeyFile Certs/server.pem .EE .RE .PP \fBopensslCipherSuiteConfig\f1 .RS .PP \fIAvailable on Linux only\f1 .PP Specify the list of supported cipher suites OpenSSL should permit when using TLS 1.3 encryption. .PP For a list of cipher suites for use with TLS 1.3, see https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_cipher_list.html (https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_cipher_list.html)\&. Multiple cipher suites can be provided as a colon\-separated list. .PP This parameter is only for use with TLS 1.3. To specify cipher strings for use with TLS 1.2 or earlier, use the \fBopensslCipherConfig\f1\f1 parameter. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, the following configures a \fBmongod\f1\f1 with a \fBopensslCipherSuiteConfig\f1\f1 cipher suite of \fB\(aqTLS_AES_256_GCM_SHA384\(aq\f1 for use with TLS 1.3: .PP .EX mongod \-\-setParameter opensslCipherSuiteConfig=\(aqTLS_AES_256_GCM_SHA384\(aq \-\-tlsMode requireTLS \-\-tlsCertificateKeyFile Certs/server.pem .EE .RE .PP \fBopensslDiffieHellmanParameters\f1 .RS .PP \fIAvailable on Linux only\f1 .PP Specify the path to the PEM file that contains the OpenSSL Diffie\-Hellman parameters when using TLS 1.2 or previous. Specifying the OpenSSL Diffie\-Hellman parameters enables support for \fBEphemeral Diffie\-Hellman (DHE)\f1 cipher suites during TLS/SSL encryption. .PP This parameter is not supported for use with TLS 1.3. .PP Ephemeral Diffie\-Hellman (DHE) cipher suites (and Ephemeral Elliptic Curve Diffie\-Hellman (ECDHE) cipher suites) provide \fBForward Secrecy\f1\&. \fBForward Secrecy\f1 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. .PP If \fBopensslDiffieHellmanParameters\f1\f1 is unset but \fBECDHE\f1 is enabled, MongoDB enables DHE using the \fBffdhe3072\f1 Diffie\-Hellman parameter, as defined in RFC\-7919#appendix\-A.2 (https://tools.ietf.org/html/7919#appendix\-A.2)\&. The \fBffdhe3072\f1 is a strong parameter (specifically, size is greater than 1024). Strong parameters are not supported with Java 6 and 7 unless extended support has been purchased from Oracle. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP If for performance reasons, you need to disable support for DHE cipher suites, use the \fBopensslCipherConfig\f1\f1 parameter: .PP .EX mongod \-\-setParameter opensslCipherConfig=\(aqHIGH:!EXPORT:!aNULL:!DHE:!kDHE@STRENGTH\(aq ... .EE .RE .PP \fBsaslauthdPath\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Specify the path to the Unix Domain Socket of the \fBsaslauthd\f1 instance to use for proxy authentication. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBsaslHostName\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fBsaslHostName\f1\f1 overrides MongoDB\(aqs default hostname detection for the purpose of configuring SASL and Kerberos authentication. .PP \fBsaslHostName\f1\f1 does not affect the hostname of the \fBmongod\f1\f1 or \fBmongos\f1\f1 instance for any purpose beyond the configuration of SASL and Kerberos. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP \fBsaslHostName\f1\f1 supports Kerberos authentication and is only included in MongoDB Enterprise. For more information, see the following: .RS .IP \(bu 2 Linux: \fBConfigure MongoDB with Kerberos Authentication on Linux\f1 .IP \(bu 2 Windows: \fBConfigure MongoDB with Kerberos Authentication on Windows\f1 .RE .RE .PP \fBsaslServiceName\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Allows users to override the default \fBKerberos\f1 service name component of the \fBKerberos\f1 principal name, on a per\-instance basis. If unspecified, the default value is \fBmongodb\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP \fBsaslServiceName\f1\f1 is only available in MongoDB Enterprise. .PP Ensure that your driver supports alternate service names. .RE .PP \fBscramIterationCount\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: \fB10000\f1 .PP Changes the number of hashing iterations used for all new \fBSCRAM\-SHA\-1\f1 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. .PP If you modify this value, it does not change the iteration count for existing passwords. The \fBscramIterationCount\f1\f1 value must be \fB5000\f1 or greater. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, the following sets the \fBscramIterationCount\f1\f1 to \fB12000\f1\&. .PP .EX mongod \-\-setParameter scramIterationCount=12000 .EE .PP Or, if using the \fBsetParameter\f1\f1 command within \fBmongosh\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, scramIterationCount: 12000 } ) .EE .RS .IP \(bu 2 \fBdb.changeUserPassword()\f1\f1 .IP \(bu 2 \fBdb.createUser()\f1\f1 .IP \(bu 2 \fBdb.updateUser()\f1\f1 .RE .RE .PP \fBscramSHA256IterationCount\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: \fB15000\f1 .PP Changes the number of hashing iterations used for all new \fBSCRAM\-SHA\-256\f1 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. .PP If you modify this value, it does not change iteration count for existing passwords. The \fBscramSHA256IterationCount\f1\f1 value must be \fB5000\f1 or greater. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, the following sets the \fBscramSHA256IterationCount\f1\f1 to \fB20000\f1\&. .PP .EX mongod \-\-setParameter scramSHA256IterationCount=20000 .EE .PP Or, if using the \fBsetParameter\f1\f1 command within \fBmongosh\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, scramSHA256IterationCount: 20000 } ) .EE .RS .IP \(bu 2 \fBdb.changeUserPassword()\f1\f1 .IP \(bu 2 \fBdb.createUser()\f1\f1 .IP \(bu 2 \fBdb.updateUser()\f1\f1 .RE .RE .PP \fBsslMode\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Set the \fBnet.ssl.mode\f1 to either \fBpreferSSL\f1 or \fBrequireSSL\f1\&. Useful during \fBrolling upgrade to TLS/SSL\f1 to minimize downtime. .PP For more information about TLS/SSL and MongoDB, see \fBConfigure mongod\f1 and mongos\f1 for TLS/SSL\f1 and \fBTLS/SSL Configuration for Clients\f1 . .PP This parameter is only available at runtime. To set the parameter, use the \fBsetParameter\f1\f1 command. .PP .EX db.adminCommand( { setParameter: 1, sslMode: "preferSSL" } ) .EE .PP \fBtlsMode\f1\f1 .RE .PP \fBtlsMode\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Set to either: .RS .IP \(bu 2 \fBpreferTLS\f1 .IP \(bu 2 \fBrequireTLS\f1 .RE .PP The \fBtlsMode\f1\f1 parameter is useful during \fBrolling upgrade to TLS/SSL\f1 to minimize downtime. .PP This parameter is only available at runtime. To set the parameter, use the \fBsetParameter\f1\f1 command. .PP .EX db.adminCommand( { setParameter: 1, tlsMode: "preferTLS" } ) .EE .PP For more information about TLS/SSL and MongoDB, see \fBConfigure mongod\f1 and mongos\f1 for TLS/SSL\f1 and \fBTLS/SSL Configuration for Clients\f1 . .PP \fBsslMode\f1\f1 .RE .PP \fBtlsClusterAuthX509Override\f1 .RS .PP Overrides the \fBclusterAuthX509\f1\f1 configuration options. .PP .EX setParameter: tlsClusterAuthX509Override: { attributes: O=MongoDB, OU=MongoDB Server } .EE .PP The parameter supports \fBattributes\f1 and \fBextensionValue\f1 overrides. .PP When the server authenticates connections from members, it analyzes the X.509 certificate to determine whether it belongs to a cluster member. If the server uses the \fBattributes\f1\f1 setting or the \fBattributes\f1 field on the \fBtlsClusterAuthX509Override\f1\f1 parameter, it checks the Distinguished Name (DN) values of the certificate. If the \fBextensionValue\f1\f1 setting or the \fBextensionValue\f1 field of the \fBtlsClusterAuthX509Override\f1\f1 parameter is set, it checks the extension values of the certificate. If it finds a match, it authorizes the connection as a peer. .PP Use this parameter to rotate certificates when the new certificates have different attributes or extension values. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBtlsOCSPStaplingTimeoutSecs\f1 .RS .PP Available for Linux. .PP The maximum number of seconds the \fBmongod\f1\f1 / \fBmongos\f1\f1 instance should wait to receive the OCSP status response for its certificates. .PP Specify an integer greater than or equal to (\fB>=\f1) 1. If unset, \fBtlsOCSPStaplingTimeoutSecs\f1\f1 uses the \fBtlsOCSPVerifyTimeoutSecs\f1\f1 value. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, the following sets the \fBtlsOCSPStaplingTimeoutSecs\f1\f1 to 20 seconds: .PP .EX mongod \-\-setParameter tlsOCSPStaplingTimeoutSecs=20 ... .EE .RS .IP \(bu 2 \fBocspEnabled\f1\f1 .IP \(bu 2 \fBocspValidationRefreshPeriodSecs\f1\f1 .IP \(bu 2 \fBtlsOCSPVerifyTimeoutSecs\f1\f1 .RE .RE .PP \fBtlsOCSPVerifyTimeoutSecs\f1 .RS .PP Available for Linux and Windows. .PP \fIDefault\f1: 5 .PP The maximum number of seconds that the \fBmongod\f1\f1 / \fBmongos\f1\f1 should wait for the OCSP response when verifying server certificates. .PP Specify an integer greater than or equal to (\fB>=\f1) 1. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, the following sets the \fBtlsOCSPVerifyTimeoutSecs\f1\f1 to 20 seconds: .PP .EX mongod \-\-setParameter tlsOCSPVerifyTimeoutSecs=20 ... .EE .RS .IP \(bu 2 \fBocspEnabled\f1\f1 .IP \(bu 2 \fBocspValidationRefreshPeriodSecs\f1\f1 .IP \(bu 2 \fBtlsOCSPStaplingTimeoutSecs\f1\f1 .RE .RE .PP \fBtlsUseSystemCA\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: false .PP Specifies whether MongoDB loads TLS certificates that are already available to the operating system\(aqs certificate authority. .PP When starting a \fBmongod\f1\f1 instance with \fBTLS/SSL enabled\f1, you must specify a value for the \fB\-\-tlsCAFile\f1\f1 flag, the \fBnet.tls.CAFile\f1\f1 configuration option, or the \fBtlsUseSystemCA\f1\f1 parameter. .PP \fB\-\-tlsCAFile\f1, \fBtls.CAFile\f1, and \fBtlsUseSystemCA\f1 are all mutually exclusive. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to set \fBtlsUseSystemCA\f1 to \fBtrue\f1: .PP .EX mongod \-\-setParameter tlsUseSystemCA=true .EE .PP For more information about TLS/SSL and MongoDB, see \fBConfigure mongod\f1 and mongos\f1 for TLS/SSL\f1 and \fBTLS/SSL Configuration for Clients\f1 . .RE .PP \fBtlsWithholdClientCertificate\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: false .PP A TLS certificate is set for a \fBmongod\f1\f1 or \fBmongos\f1\f1 either by the \fB\-\-tlsClusterFile\f1\f1 option or by the \fB\-\-tlsCertificateKeyFile\f1\f1 option when \fB\-\-tlsClusterFile\f1\f1 is not set. If the TLS certificate is set, by default, the instance sends the certificate when initiating intra\-cluster communications with other \fBmongod\f1\f1 or \fBmongos\f1\f1 instances in the deployment. Set \fBtlsWithholdClientCertificate\f1 to \fB1\f1 or \fBtrue\f1 to direct the instance to withhold sending its TLS certificate during these communications. Use this option with \fB\-\-tlsAllowConnectionsWithoutCertificates\f1\f1 (to allow inbound connections without certificates) on all members of the deployment. \fBtlsWithholdClientCertificate\f1 is mutually exclusive with \fB\-\-clusterAuthMode x509\f1\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBtlsX509ClusterAuthDNOverride\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP An alternative Distinguished Name (DN) that the instance can also use to identify members of the deployment. .PP For a MongoDB deployment that uses x.509 certificates for \fBclusterAuthMode\f1\f1, deployment members identify each other using x.509 certificates ( \fBnet.tls.clusterFile\f1\f1, if specified, and \fBnet.tls.certificateKeyFile\f1\f1) during intra\-cluster communications. For members of the same deployment, the \fBDN\f1 from their certificates must have the same Organization attributes (\fBO\f1\(aqs), the Organizational Unit attributes (\fBOU\f1\(aqs), and the Domain Components (\fBDC\f1\(aqs). .PP If \fBtlsX509ClusterAuthDNOverride\f1\f1 is set for a member, the member can also use the override value when comparing the \fBDN\f1 components (\fBO\f1\(aqs, \fBOU\f1\(aqs, and \fBDC\f1\(aqs) of the presented certificates. That is the member checks the presented certificates against its \fBnet.tls.clusterFile\f1\f1/\fBnet.tls.certificateKeyFile\f1\f1\&. If the DN does not match, the member checks the presented certificate against the \fBtlsX509ClusterAuthDNOverride\f1\f1 value. .PP If set, you must set this parameter on all members of the deployment. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP You can use this parameter for a rolling update of certificates to new certificates that contain a new \fBDN\f1 value. See \fBRolling Update of x.509 Cluster Certificates that Contain New DN\f1\&. .PP For more information about membership certificate requirements, see \fBMember Certificate Requirements\f1 for details. .RE .PP \fBtlsX509ExpirationWarningThresholdDays\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1 : 30 .PP \fBmongod\f1\f1 / \fBmongos\f1\f1 logs a warning on connection if the presented x.509 certificate expires within \fB30\f1 days of the \fBmongod/mongos\f1 system clock. Use the \fBtlsX509ExpirationWarningThresholdDays\f1\f1 parameter to control the certificate expiration warning threshold: .RS .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\f1 to disable the warning. .RE .PP This parameter has a minimum value of \fB0\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP See \fBx.509 Certificates Nearing Expiry Trigger Warnings\f1 for more information on x.509 expiration warnings. .PP For more information on x.509 certificate validity, see RFC 5280 4.1.2.5 (https://tools.ietf.org/html/rfc5280#section\-4.1.2.5)\&. .RE .PP \fBuserCacheInvalidationIntervalSecs\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIDefault\f1: 30 .PP On a \fBmongos\f1\f1 instance, specifies the interval (in seconds) at which the \fBmongos\f1\f1 instance checks to determine whether the in\-memory cache of \fBuser objects\f1 has stale data, and if so, clears the cache. If there are no changes to user objects, \fBmongos\f1\f1 will not clear the cache. .PP This parameter has a minimum value of \fB1\f1 second and a maximum value of \fB86400\f1 seconds (24 hours). .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBauthFailedDelayMs\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: 0 .PP Available in MongoDB Enterprise only. .PP The number of milliseconds to wait before informing clients that their authentication attempt has failed. This parameter may be in the range \fB0\f1 to \fB5000\f1, inclusive. .PP 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. .RE .PP \fBallowRolesFromX509Certificates\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: true .PP A boolean flag that allows or disallows the retrieval of authorization roles from client x.509 certificates. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .SS GENERAL PARAMETERS .PP \fBallowDiskUseByDefault\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIDefault\f1: True .PP Starting in MongoDB 6.0, pipeline stages that require more than 100 megabytes of memory to execute write temporary files to disk by default. These temporary files last for the duration of the pipeline execution and can influence storage space on your instance. In earlier versions of MongoDB, you must pass \fB{ allowDiskUse: true }\f1 to individual \fBfind\f1 and \fBaggregate\f1 commands to enable this behavior. .PP Individual \fBfind\f1 and \fBaggregate\f1 commands can override the \fBallowDiskUseByDefault\f1\f1 parameter by either: .RS .IP \(bu 2 Using \fB{ allowDiskUse: true }\f1 to allow writing temporary files out to disk when \fBallowDiskUseByDefault\f1 is set to \fBfalse\f1 .IP \(bu 2 Using \fB{ allowDiskUse: false }\f1 to prohibit writing temporary files out to disk when \fBallowDiskUseByDefault\f1 is set to \fBtrue\f1 .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX mongod \-\-setParameter allowDiskUseByDefault=false .EE .PP \fBallowDiskUseByDefault\f1\f1 only works on \fBmongod\f1\f1 not \fBmongos\f1\f1\&. \fBmongos\f1\f1 never writes temporary files to disk. Use the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongod\f1\f1 to change the value of the parameter while the server is running: .PP .EX db.adminCommand( { setParameter: 1, allowDiskUseByDefault: false } ) .EE .RE .PP \fBhttpVerboseLogging\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Adds more verbose tracing for curl on Linux and macOS. Has no affect on Windows. .PP By default, the parameter is unset. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX mongos \-\-setParameter httpVerboseLogging=true .EE .RE .PP \fBslowConnectionThresholdMillis\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: 100 .PP Sets the time limit in milliseconds to log the establishment of slow server connections. .PP If a connection takes longer to establish than the \fBslowConnectionThresholdMillis\f1\f1 parameter, an event is added to the \fBlog\f1 with the message \fBmsg\f1 field set to \fB"Slow connection establishment"\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBslowConnectionThresholdMillis\f1\f1 to \fB250\f1 milliseconds. .PP .EX mongod \-\-setParameter slowConnectionThresholdMillis=250 .EE .PP Or, if using the \fBsetParameter\f1\f1 command within \fBmongosh\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, slowConnectionThresholdMillis: 250 } ) .EE .RE .PP \fBconnPoolMaxConnsPerHost\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: 200 .PP Sets the maximum size of the legacy connection pools for outgoing connections to other \fBmongod\f1\f1 instances in the global connection pool. The size of a pool does not prevent the creation of additional connections, but \fIdoes\f1 prevent a connection pool from retaining connections in excess of the value of \fBconnPoolMaxConnsPerHost\f1\f1\&. .PP The parameter is separate from the connections in TaskExecutor pools. See \fBShardingTaskExecutorPoolMaxSize\f1\f1\&. .PP \fBOnly\f1 adjust this setting if your driver does \fInot\f1 pool connections and you\(aqre using authentication in the context of a sharded cluster. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX mongod \-\-setParameter connPoolMaxConnsPerHost=250 .EE .RE .PP \fBconnPoolMaxInUseConnsPerHost\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Sets the maximum number of in\-use connections at any given time for for outgoing connections to other \fBmongod\f1\f1 instances in the legacy global connection pool. .PP By default, the parameter is unset. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX mongod \-\-setParameter connPoolMaxInUseConnsPerHost=100 .EE .PP \fBconnPoolMaxConnsPerHost\f1\f1 .RE .PP \fBglobalConnPoolIdleTimeoutMinutes\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Sets the time limit that connection in the legacy global connection pool can remain idle before being closed. .PP By default, the parameter is unset. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX mongos \-\-setParameter globalConnPoolIdleTimeoutMinutes=10 .EE .RE .PP \fBcursorTimeoutMillis\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: 600000 (10 minutes) .PP Sets the expiration threshold in milliseconds for idle cursors before MongoDB removes them; specifically, MongoDB removes cursors that have been idle for the specified \fBcursorTimeoutMillis\f1\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, the following sets the \fBcursorTimeoutMillis\f1\f1 to \fB300000\f1 milliseconds (5 minutes). .PP .EX mongod \-\-setParameter cursorTimeoutMillis=300000 .EE .PP Or, if using the \fBsetParameter\f1\f1 command within \fBmongosh\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, cursorTimeoutMillis: 300000 } ) .EE .PP Setting \fBcursorTimeoutMillis\f1\f1 to less than or equal to \fB0\f1 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()\f1\f1 cursor modifier to analyze the average query time and select an appropriate timeout period. .PP MongoDB cleans up \fBorphaned cursors\f1 linked to sessions as part of session management. This means that orphaned cursors with session ids do not use \fBcursorTimeoutMillis\f1 to control the timeout. .PP For operations that return a cursor and have an idle period longer than \fBlocalLogicalSessionTimeoutMinutes\f1\f1, use \fBMongo.startSession()\f1\f1 to perform the operation within an explicit session. To refresh the session, run the \fBrefreshSessions\f1\f1 command. For details, see \fBRefresh a Cursor with refreshSessions\f1\f1\&. .RE .PP \fBmaxNumActiveUserIndexBuilds\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 3 .PP Sets the maximum number of concurrent index builds allowed on the \fBprimary\f1\&. This is a global limit that applies across all collections. .PP Increasing the value of \fBmaxNumActiveUserIndexBuilds\f1 allows additional concurrent index builds at the cost of increased pressure on the WiredTiger cache. .PP System indexes are not limited to \fBmaxNumActiveUserIndexBuilds\f1, however a system index build counts against the limit for user index builds. .PP After the server reaches \fBmaxNumActiveUserIndexBuilds\f1, it blocks additional user index builds until the number of concurrent index builds drops below the \fBmaxNumActiveUserIndexBuilds\f1 limit. If an index build is blocked, the server logs this message: .PP .EX Too many index builds running simultaneously, waiting until the number of active index builds is below the threshold. .EE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following command sets a limit of 4 concurrent index builds: .PP .EX db.adminCommand( { setParameter: 1, maxNumActiveUserIndexBuilds: 4 } ) .EE .PP See also: .RS .IP \(bu 2 \fBmaxIndexBuildMemoryUsageMegabytes\f1\f1 .IP \(bu 2 \fBIndex Builds on Populated Collections\f1 .RE .RE .PP \fBnotablescan\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Specify whether \fBall\f1 queries must use indexes. If \fB1\f1, MongoDB will not execute queries that require a collection scan and will return an error. .PP Consider the following example which sets \fBnotablescan\f1\f1 to \fB1\f1 or true: .PP .EX db.adminCommand( { setParameter: 1, notablescan: 1 } ) .EE .PP Setting \fBnotablescan\f1\f1 to \fB1\f1 can be useful for testing application queries, for example, to identify queries that scan an entire collection and cannot use an index. .PP To detect unindexed queries without \fBnotablescan\f1, consider reading the \fBAnalyze Query Performance\f1 and \fBOptimize Query Performance\f1 sections and using the \fBlogLevel\f1\f1 parameter, \fBmongostat\f1\f1 and \fBprofiling\f1\&. .PP Don\(aqt run production \fBmongod\f1\f1 instances with \fBnotablescan\f1\f1 because preventing collection scans can potentially affect queries in all databases, including administrative queries. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP \fBnotablescan\f1 does not allow unbounded queries that use a clustered index because the queries require a full collection scan. For more information, see \fBCollection Scans\f1\&. .RE .PP \fBttlMonitorEnabled\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIDefault\f1: \fBtrue\f1 .PP To support \fBTTL Indexes\f1, \fBmongod\f1\f1 instances have a background thread that is responsible for deleting documents from collections with TTL indexes. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP To disable this worker thread for a \fBmongod\f1\f1, set \fBttlMonitorEnabled\f1\f1 to \fBfalse\f1, as in the following operations: .PP .EX db.adminCommand( { setParameter: 1, ttlMonitorEnabled: false } ) .EE .PP Alternately, you may disable the thread at startup time by starting the \fBmongod\f1\f1 instance with the following option: .PP .EX mongod \-\-setParameter ttlMonitorEnabled=false .EE .PP Do not run production \fBmongod\f1\f1 instances with \fBttlMonitorEnabled\f1 disabled, except under guidance from MongoDB support. Preventing TTL document removal can negatively impact MongoDB internal system operations that depend on TTL Indexes. .RE .PP \fBtcpFastOpenServer\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: \fBtrue\f1 .PP Enables support for accepting inbound TCP Fast Open (TFO) connections to the \fBmongod/mongos\f1 from a client. TFO requires both the client and \fBmongod/mongos\f1 host machine support and enable TFO: .PP \fBWindows\f1 .RS .PP The following Windows operating systems support TFO: .RS .IP \(bu 2 Microsoft Windows Server 2016 and later. .IP \(bu 2 Microsoft Windows 10 Update 1607 and later. .RE .RE .PP \fBmacOS\f1 .RS .PP macOS 10.11 (El Capitan) and later support TFO. .RE .PP \fBLinux\f1 .RS .PP Linux operating systems running Linux Kernel 3.7 or later can support inbound TFO. .PP Set the value of \fB/proc/sys/net/ipv4/tcp_fastopen\f1 to enable inbound TFO connections: .RS .IP \(bu 2 Set to \fB2\f1 to enable only inbound TFO connections. .IP \(bu 2 Set to \fB3\f1 to enable inbound and outbound TFO connections. .RE .RE .PP This parameter has no effect if the host operating system does not support \fIor\f1 is not configured to support TFO connections. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP See \fBSupport for TCP Fast Open\f1 for more information on MongoDB TFO support. .PP RFC7413 (https://tools.ietf.org/html/rfc7413)\&. .RE .PP \fBtcpFastOpenClient\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: \fBtrue\f1 .PP \fILinux Operating System Only\f1 .PP Enables support for outbound TCP Fast Open (TFO) connections from the \fBmongod/mongos\f1 to a client. TFO requires both the client and the \fBmongod/mongos\f1 host machine support and enable TFO. .PP Linux operating systems running Linux Kernel 4.11 or later can support outbound TFO. .PP Set the value of \fB/proc/sys/net/ipv4/tcp_fastopen\f1 to enable outbound TFO connections: .RS .IP \(bu 2 \fB1\f1 to enable only outbound TFO connections. .IP \(bu 2 \fB3\f1 to enable inbound and outbound TFO connections. .RE .PP This parameter has no effect if the host operating system does not support \fIor\f1 is not configured to support TFO connections. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP See \fBSupport for TCP Fast Open\f1 for more information on MongoDB TFO support. .PP RFC7413 (https://tools.ietf.org/html/rfc7413)\&. .RE .PP \fBtcpFastOpenQueueSize\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIDefault\f1: \fB1024\f1 .PP As part of establishing a TCP Fast Open (TFO) connection, the client submits a valid TFO cookie to the \fBmongod/mongos\f1 \fIbefore\f1 completion of the standard TCP 3\-way handshake. The \fBmongod/mongos\f1 keeps a queue of all such pending TFO connections. .PP The \fBtcpFastOpenQueueSize\f1 parameter sets the size of the queue of pending TFO connections. While the queue is full, the \fBmongod/mongos\f1 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\f1 begins accepting new TFO cookies. .RS .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. .IP The minimum queue size is \fB0\f1\&. A queue of \fB0\f1 effectively disables TFO. .RE .PP This parameter has no effect on host operating systems that do not support or are not configured for TFO connections. See \fBSupport for TCP Fast Open\f1 for more information on MongoDB TFO support. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RS .IP \(bu 2 RFC7413 TCP Fast Open Section 5: Security Considerations (https://tools.ietf.org/html/rfc7413#section\-5) .IP \(bu 2 RFC7413 TCP Fast Open Section 6: TFO Applicability (https://tools.ietf.org/html/rfc7413#section\-6) .RE .RE .PP \fBdisableJavaScriptJIT\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP The MongoDB JavaScript engine uses SpiderMonkey, which implements Just\-in\-Time (JIT) compilation for improved performance when running scripts. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP To enable the JIT, set \fBdisableJavaScriptJIT\f1\f1 to \fBfalse\f1, as in the following example: .PP .EX db.adminCommand( { setParameter: 1, disableJavaScriptJIT: false } ) .EE .PP \fB$where\f1\f1 will reuse existing JavaScript interpreter contexts, so changes to \fBdisableJavaScriptJIT\f1\f1 may not take effect immediately for these operations. .PP Alternately, you may enable the JIT at startup time by starting the \fBmongod\f1\f1 instance with the following option: .PP .EX mongod \-\-setParameter disableJavaScriptJIT=false .EE .RE .PP \fBindexBuildMinAvailableDiskSpaceMB\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIDefault\f1: 500 MB .PP Sets the minimum available disk space in megabytes required for index builds. .PP Must be greater than or equal to 0 MB, and less than or equal to 8 TB. 0 disables the minimum disk space requirement. .PP A new index build cannot be started and a current index build is cancelled if the available disk space is below \fBindexBuildMinAvailableDiskSpaceMB\f1\&. .PP If you increase \fBindexBuildMinAvailableDiskSpaceMB\f1, ensure your server has enough available disk space. Also, if you set \fBindexBuildMinAvailableDiskSpaceMB\f1 too high, you might needlessly prevent index builds when there is enough available disk space and \fBindexBuildMinAvailableDiskSpaceMB\f1 could be set lower. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBindexBuildMinAvailableDiskSpaceMB\f1 to 650 MB: .PP .EX db.adminCommand( { setParameter: 1, indexBuildMinAvailableDiskSpaceMB: 650 } ) .EE .PP You can also set \fBindexBuildMinAvailableDiskSpaceMB\f1 at startup. For example: .PP .EX mongod \-\-setParameter indexBuildMinAvailableDiskSpaceMB=650 .EE .RE .PP \fBindexMaxNumGeneratedKeysPerDocument\f1 .RS .PP \fIDefault\f1: 100000 .PP Limits the maximum number of keys generated for a document to prevent out of memory errors. It is possible to raise the limit, but if an operation requires more keys than the \fBindexMaxNumGeneratedKeysPerDocument\f1\f1 parameter specifies, the operation will fail. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBmaxIndexBuildMemoryUsageMegabytes\f1 .RS .PP \fIDefault\f1: 200 .PP 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\f1\f1 command or its shell helper \fBdb.collection.createIndexes()\f1\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The memory consumed by an index build is separate from the WiredTiger cache memory (see \fBcacheSizeGB\f1\f1). .PP \fBmaxIndexBuildMemoryUsageMegabytes\f1 sets a limit on how much memory the index build uses at once. This can impact performance when the \fBindex build process\f1 generates and sorts keys for the index. Increasing the memory limit improves sorting performance during an index build. .PP Index builds may be initiated either by a user command such as \fBcreateIndexes\f1\f1 or by an administrative process such as an \fBinitial sync\f1\&. Both are subject to the limit set by \fBmaxIndexBuildMemoryUsageMegabytes\f1\f1\&. .PP An \fBinitial sync\f1 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 by \fBmaxIndexBuildMemoryUsageMegabytes\f1\f1\&. .PP 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 \fBRolling Index Builds on Replica Sets\f1\&. .PP Changing \fBmaxIndexBuildMemoryUsageMegabytes\f1 does not affect an in progress index build if it has already started a collection scan. However, a forced replica set reconfiguration restarts the collection scan and uses the most current \fBmaxIndexBuildMemoryUsageMegabytes\f1 provided. .RS .IP \(bu 2 For \fBfeature compatibility version (fcv)\f1 \fB"4.2"\f1 and later, the index build memory limit applies to all index builds. .RE .RE .PP \fBreportOpWriteConcernCountersInServerStatus\f1 .RS .PP \fIDefault\f1: false .PP A boolean flag that determines whether the \fBdb.serverStatus()\f1\f1 method and \fBserverStatus\f1\f1 command return \fBopWriteConcernCounters\f1\f1 information. .PP .EX mongod \-\-setParameter reportOpWriteConcernCountersInServerStatus=true .EE .RE .PP \fBwatchdogPeriodSeconds\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: \-1 (disabled) .PP Determines how frequent the \fBStorage Node Watchdog\f1 checks the status of the monitored filesystems: .RS .IP \(bu 2 The \fB\-\-dbpath\f1\f1 directory .IP \(bu 2 The \fBjournal\f1 directory inside the \fB\-\-dbpath\f1\f1 directory .IP \(bu 2 The directory of \fB\-\-logpath\f1\f1 file .IP \(bu 2 The directory of \fB\-\-auditPath\f1\f1 file .RE .PP Valid values for \fBwatchdogPeriodSeconds\f1\f1 are: .RS .IP \(bu 2 \fB\-1\f1 (the default), to disable/pause \fBStorage Node Watchdog\f1, or .IP \(bu 2 An integer greater than or equal to 60. .RE .RS .IP \(bu 2 If a filesystem on a monitored directory becomes unresponsive, it can take a maximum of nearly \fItwice\f1 the value of \fBwatchdogPeriodSeconds\f1\f1 to terminate the \fBmongod\f1\f1\&. .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\f1\f1 uses \fBstorage.directoryPerDB: true\f1\f1 (or \fB\-\-directoryperdb\f1\f1) and symlinks a database directory to another volume, the Storage Node Watchdog does not follow the symlink to monitor the target. .RE .PP To enable \fBStorage Node Watchdog\f1, \fBwatchdogPeriodSeconds\f1\f1 must be set during startup. .PP .EX mongod \-\-setParameter watchdogPeriodSeconds=60 .EE .PP You can only enable the \fBStorage Node Watchdog\f1 at startup. However, once enabled, you can pause the \fBStorage Node Watchdog\f1 or change the \fBwatchdogPeriodSeconds\f1\f1 during run time. .PP Once enabled, .RS .IP \(bu 2 To pause the \fBStorage Node Watchdog\f1 during run time, set \fBwatchdogPeriodSeconds\f1\f1 to \-1. .IP .EX db.adminCommand( { setParameter: 1, watchdogPeriodSeconds: \-1 } ) .EE .IP \(bu 2 To resume or change the period during run time, set \fBwatchdogPeriodSeconds\f1\f1 to a number greater than or equal to 60. .IP .EX db.adminCommand( { setParameter: 1, watchdogPeriodSeconds: 120 } ) .EE .RE .PP It is an error to set \fBwatchdogPeriodSeconds\f1\f1 at run time if the \fBStorage Node Watchdog\f1 was not enabled at startup time. .RE .PP \fBtcmallocAggressiveMemoryDecommit\f1 .RS .PP To release memory back to the operating system, consider using \fBtcmallocEnableBackgroundThread\f1\f1 instead. .PP \fIType\f1: integer (\fB0\f1 or \fB1\f1 only) .PP Default: 0 .PP If you enable \fBtcmallocAggressiveMemoryDecommit\f1, MongoDB: .RS .IP \(bu 2 releases a \fBchunk\f1 of memory to system, and .IP \(bu 2 attempts to return all neighboring free chunks. .RE .PP A value of \fB1\f1 enables \fBtcmallocAggressiveMemoryDecommit\f1; \fB0\f1 disables this parameter. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP If you enable this parameter, the system will require new memory allocations for use. Consider enabling \fBtcmallocAggressiveMemoryDecommit\f1 only on memory\-constrained systems and after pursuing other memory and performance options. .RE .PP \fBtcmallocEnableBackgroundThread\f1 .RS .PP \fIType\f1: boolean .PP Default: true .PP If set to \fBtrue\f1, \fBtcmallocEnableBackgroundThread\f1 creates a background thread that periodically releases memory back to the operating system. The value of \fBtcmallocReleaseRate\f1\f1 determines the rate, in bytes per second, at which the background thread releases memory. .PP If \fBtcmallocEnableBackgroundThread\f1 is \fBtrue\f1 and \fBtcmallocReleaseRate\f1 is \fB0\f1, MongoDB still releases memory. .PP For improved memory usage, we recommend using the default value of \fBtrue\f1\&. To learn more about improvements to performance and memory management, see \fBUpgraded TCMalloc\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP The following operation sets \fBtcmallocEnableBackgroundThread\f1 to \fBfalse\f1: .PP .EX mongod \-\-setParameter "tcmallocEnableBackgroundThread=false" .EE .RE .PP \fBtcmallocReleaseRate\f1 .RS .PP Default: 0 .PP Specifies the tcmalloc release rate (https://github.com/google/tcmalloc/blob/master/docs/tuning.md) in bytes per second. Release rate refers to the rate at which MongoDB releases unused memory to the system. If \fBtcmallocReleaseRate\f1 is set to \fB0\f1 MongoDB doesn\(aqt release memory back to the system. Increase this value to return memory faster; decrease it to return memory slower. .PP If \fBtcmallocEnableBackgroundThread\f1 is \fBtrue\f1 and \fBtcmallocReleaseRate\f1 is \fB0\f1, MongoDB still releases memory. .PP Starting in MongoDB 8.0, the default value of \fBtcmallocReleaseRate\f1 is reduced to \fB0\f1 due to a \fBtcmalloc upgrade\f1 that prioritizes CPU performance over memory release. Earlier versions of MongoDB used an older version of \fBtcmalloc\f1 that set the default \fBtcmallocReleaseRate\f1 to \fB1\f1 to balance memory release and performance. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP To modify the release rate during run time, you can use the \fBsetParameter\f1\f1 command; for example: .PP .EX db.adminCommand( { setParameter: 1, tcmallocReleaseRate: 5.0 } ) .EE .PP You can also set \fBtcmallocReleaseRate\f1\f1 at startup time; for example: .PP .EX mongod \-\-setParameter "tcmallocReleaseRate=5.0" .EE .RE .PP \fBfassertOnLockTimeoutForStepUpDown\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Default: 15 seconds .PP Allows a server that receives a request to step up or step down, to terminate if it is unable to comply (for example due to faulty server disks) within the timeout. This enables a cluster to successfully elect a new primary node and thus continue to be available. .PP \fBfassertOnLockTimeoutForStepUpDown\f1 defaults to 15 seconds. To disable nodes from fasserting, set \fBfassertOnLockTimeoutForStepUpDown=0\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example disables nodes from fasserting: .PP .EX mongod \-\-setParameter fassertOnLockTimeoutForStepUpDown=0 .EE .RE .SS LOGGING PARAMETERS .PP \fBlogLevel\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Specify an integer between \fB0\f1 and \fB5\f1 signifying the verbosity of the \fBlogging\f1, where \fB5\f1 is the most verbose. .PP The default \fBlogLevel\f1\f1 is \fB0\f1 (Informational). .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets the \fBlogLevel\f1\f1 to \fB2\f1: .PP .EX db.adminCommand( { setParameter: 1, logLevel: 2 } ) .EE .RS .IP \(bu 2 \fBlogComponentVerbosity\f1\f1 .IP \(bu 2 \fBsystemLog.verbosity\f1\f1 .RE .RE .PP \fBlogComponentVerbosity\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Sets the verbosity levels of various \fBcomponents\f1 for \fBlog messages\f1\&. The verbosity level determines the amount of \fBInformational and Debug\f1 messages MongoDB outputs. .PP The verbosity level can range from \fB0\f1 to \fB5\f1: .RS .IP \(bu 2 \fB0\f1 is the MongoDB\(aqs default log verbosity level, to include \fBInformational\f1 messages. .IP \(bu 2 \fB1\f1 to \fB5\f1 increases the verbosity level to include \fBDebug\f1 messages. .RE .PP For a component, you can also specify \fB\-1\f1 to inherit the parent\(aqs verbosity level. .PP To specify the verbosity level, use a document similar to the following: .PP .EX { verbosity: , : { verbosity: }, : { verbosity: , : { verbosity: } }, ... } .EE .PP For the components, you can specify just the \fB: \f1 in the document, unless you are setting both the parent verbosity level and that of the child component(s) as well: .PP .EX { verbosity: , : , : { verbosity: , : } ... } .EE .PP The top\-level \fBverbosity\f1 field corresponds to \fBsystemLog.verbosity\f1\f1 which sets the default level for all components. The default value of \fBsystemLog.verbosity\f1\f1 is \fB0\f1\&. .PP The components correspond to the following settings: .RS .IP \(bu 2 \fBaccessControl\f1\f1 .IP \(bu 2 \fBcommand\f1\f1 .IP \(bu 2 \fBcontrol\f1\f1 .IP \(bu 2 \fBftdc\f1\f1 .IP \(bu 2 \fBgeo\f1\f1 .IP \(bu 2 \fBindex\f1\f1 .IP \(bu 2 \fBnetwork\f1\f1 .IP \(bu 2 \fBquery\f1\f1 .IP \(bu 2 \fBreplication\f1\f1 .IP \(bu 2 \fBreplication.election\f1\f1 .IP \(bu 2 \fBreplication.heartbeats\f1\f1 .IP \(bu 2 \fBreplication.initialSync\f1\f1 .IP \(bu 2 \fBreplication.rollback\f1\f1 .IP \(bu 2 \fBrecovery\f1\f1 .IP \(bu 2 \fBsharding\f1\f1 .IP \(bu 2 \fBstorage\f1\f1 .IP \(bu 2 \fBstorage.journal\f1\f1 .IP \(bu 2 \fBtransaction\f1\f1 .IP \(bu 2 \fBwrite\f1\f1 .RE .PP Unless explicitly set, the component has the verbosity level of its parent. For example, \fBstorage\f1 is the parent of \fBstorage.journal\f1\&. That is, if you specify a \fBstorage\f1\f1 verbosity level, this level also applies to: .RS .IP \(bu 2 \fBstorage.journal\f1\f1 components \fIunless\f1 you specify the verbosity level for \fBstorage.journal\f1\f1\&. .IP \(bu 2 \fBstorage.recovery\f1\f1 components \fIunless\f1 you specify the verbosity level for \fBstorage.recovery\f1\f1\&. .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, the following sets the \fBdefault verbosity level\f1\f1 to \fB1\f1, the \fBquery\f1\f1 to \fB2\f1, the \fBstorage\f1\f1 to \fB2\f1, and the \fBstorage.journal\f1\f1 to \fB1\f1\&. .PP .EX db.adminCommand( { setParameter: 1, logComponentVerbosity: { verbosity: 1, query: { verbosity: 2 }, storage: { verbosity: 2, journal: { verbosity: 1 } } } } ) .EE .PP You can also set parameter \fBlogComponentVerbosity\f1\f1 at startup time, passing the verbosity level document as a string. .PP .EX mongod \-\-setParameter "logComponentVerbosity={command: 3}" .EE .PP \fBmongosh\f1\f1 also provides the \fBdb.setLogLevel()\f1\f1 to set the log level for a single component. For various ways to set the log verbosity level, see \fBConfigure Log Verbosity Levels\f1\&. .RE .PP \fBmaxLogSizeKB\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: non\-negative integer .PP \fIDefault\f1: 10 .PP Specifies the maximum size, in kilobytes, for an individual attribute field in a log entry; attributes exceeding this limit are truncated. .PP Truncated attribute fields print field content up to the \fBmaxLogSizeKB\f1\f1 limit and excise field content past that limit, retaining valid JSON formatting. Log entries that contain truncated attributes append a \fBtruncated\f1 object to the end of the log entry. .PP See \fBlog message truncation\f1 for more information. .PP A value of \fB0\f1 disables truncation entirely. Negative values for this parameter are not valid. .PP Using a large value, or disabling truncation with a value of \fB0\f1, may adversely affect system performance and negatively impact database operations. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets the maximum log line size to \fB20\f1 kilobytes: .PP .EX mongod \-\-setParameter maxLogSizeKB=20 .EE .RE .PP \fBprofileOperationResourceConsumptionMetrics\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: false .PP Flag that determines whether operations collect resource consumption metrics and report them in the slow query logs. If you enable \fBprofiling\f1, these metrics are also included. .PP If set to \fBtrue\f1, running the \fBexplain\f1\f1 command returns \fBoperationMetrics\f1 when the verbosity is \fBexecutionStats\f1 or higher. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBquiet\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Sets quiet logging mode. If \fB1\f1, \fBmongod\f1\f1 will go into a quiet logging mode which will not log the following events/activities: .RS .IP \(bu 2 connection events; .IP \(bu 2 the \fBdrop\f1\f1 command, the \fBdropIndexes\f1\f1 command, the \fBvalidate\f1\f1 command; and .IP \(bu 2 replication synchronization activities. .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP Consider the following example which sets the \fBquiet\f1 parameter to \fB1\f1: .PP .EX db.adminCommand( { setParameter: 1, quiet: 1 } ) .EE .PP \fBsystemLog.quiet\f1\f1 .RE .PP \fBredactClientLogData\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP Available in MongoDB Enterprise only. .PP Configure the \fBmongod\f1\f1 or \fBmongos\f1\f1 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. .PP Use \fBredactClientLogData\f1\f1 in conjunction with \fBEncryption at Rest\f1 and \fBTLS/SSL (Transport Encryption)\f1 to assist compliance with regulatory requirements. .PP To enable log redaction at startup, you can either: .RS .IP \(bu 2 Start \fBmongod\f1\f1 with the \fB\-\-redactClientLogData\f1\f1 option: .IP .EX mongod \-\-redactClientLogData .EE .IP \(bu 2 Set the \fBsecurity.redactClientLogData\f1\f1 option in the \fBconfiguration file\f1: .IP .EX security: redactClientLogData: true ... .EE .RE .PP You can\(aqt use the \fB\-\-setParameter\f1\f1 option to set \fBredactClientLogData\f1\f1 at startup. .PP To enable log redaction on a running \fBmongod\f1 or \fBmongos\f1, use the following command: .PP .EX db.adminCommand( { setParameter: 1, redactClientLogData : true } ) .EE .PP \fBsecurity.redactClientLogData\f1\f1 .RE .PP \fBredactEncryptedFields\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP \fIDefault\f1: \fBtrue\f1 .PP Configures \fBmongod\f1\f1 and \fBmongos\f1\f1 to redact field values of encrypted \fBBinary\f1\f1 data from all \fBlog messages\f1\&. .RS .IP \(bu 2 If the \fBredactClientLogData\f1\f1 parameter or the \fBsecurity.redactClientLogData\f1\f1 setting is set to \fBfalse\f1 and \fBredactEncryptedFields\f1 is set to \fBtrue\f1 (the default), encrypted fields are redacted from all log messages. .IP \(bu 2 If the \fBredactClientLogData\f1\f1 parameter or \fBsecurity.redactClientLogData\f1\f1 setting is set to \fBtrue\f1, all fields are redacted, regardless of the \fBredactEncryptedFields\f1 setting. .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBtraceExceptions\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Configures \fBmongod\f1\f1 to log full source code stack traces for every database and socket C++ exception, for use with debugging. If \fBtrue\f1, \fBmongod\f1\f1 will log full stack traces. .PP This parameter is only available at runtime. To set the parameter, use the \fBsetParameter\f1\f1 command. .PP Consider the following example which sets the \fBtraceExceptions\f1 to \fBtrue\f1: .PP .EX db.adminCommand( { setParameter: 1, traceExceptions: true } ) .EE .PP \fBsystemLog.traceAllExceptions\f1\f1 .RE .PP \fBsuppressNoTLSPeerCertificateWarning\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP \fIDefault\f1: false .PP By default, a \fBmongod\f1\f1 or \fBmongos\f1\f1 with \fBTLS/SSL enabled\f1 and \fBnet.ssl.allowConnectionsWithoutCertificates\f1 : \fBtrue\f1 lets clients connect without providing a certificate for validation while logging an warning. Set \fBsuppressNoTLSPeerCertificateWarning\f1 to \fB1\f1 or \fBtrue\f1 to suppress those warnings. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP The following operation sets \fBsuppressNoTLSPeerCertificateWarning\f1 to \fBtrue\f1: .PP .EX db.adminCommand( { setParameter: 1, suppressNoTLSPeerCertificateWarning: true} ) .EE .RE .PP \fBenableDetailedConnectionHealthMetricLogLines\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP Determines whether to enable specific log messages related to cluster connection health metrics. If \fBenableDetailedConnectionHealthMetricLogLines\f1\f1 is set to \fBfalse\f1, the following log messages are turned off, but MongoDB still collects data on the cluster connection health metrics: .RS .IP \(bu 2 .RS .IP \(bu 4 Log Message .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 Accepted TLS connection from peer .IP \(bu 4 Indicates that the server successfully parsed the peer certificate during the TLS handshake with an accepted ingress connection. .RE .IP \(bu 2 .RS .IP \(bu 4 Ingress TLS handshake complete .IP \(bu 4 Indicates that the TLS handshake with an ingress connection is complete. .RE .IP \(bu 2 .RS .IP \(bu 4 Hello completed .IP \(bu 4 Indicates that the initial connection handshake completed on an incoming client connection. .IP MongoDB displays the log message only with the first \fBhello\f1 command. .RE .IP \(bu 2 .RS .IP \(bu 4 Auth metrics report .IP \(bu 4 Specifies the completion of a step in the authentication conversation. .RE .IP \(bu 2 .RS .IP \(bu 4 Received first command on ingress connection since session start or auth handshake .IP \(bu 4 Indicates that an ingress connection received the first command that is not part of the handshake. .RE .IP \(bu 2 .RS .IP \(bu 4 Slow network response send time .IP \(bu 4 Indicates that the time spent, in milliseconds, to send the response back to the client over an ingress connection takes more time than the duration defined by the \fBslowMS\f1 server parameter. .RE .IP \(bu 2 .RS .IP \(bu 4 Completed client\-side verification of OCSP request .IP \(bu 4 If the peer doesn\(aqt include an OCSP (Online Certificate Status Protocol) response to the TLS handshake when an egress TLS connection is established, the server must send an OCSP request to the certificate authority. MongoDB writes this log message when the certificate authority receives the OCSP response. .RE .IP \(bu 2 .RS .IP \(bu 4 Slow connection establishment .IP \(bu 4 Indicates that the time taken to send a response back to the client over an ingress connection takes longer than the threshold specified with the \fBslowConnectionThresholdMillis\f1\f1 parameter. MongoDB also emits this log message when the connection establishment times out. .RE .IP \(bu 2 .RS .IP \(bu 4 Operation timed out while waiting to acquire connection .IP \(bu 4 Indicates that an operation timed out while waiting to acquire an egress connection. .RE .IP \(bu 2 .RS .IP \(bu 4 Acquired connection for remote operation and completed writing to wire .IP \(bu 4 Indicates that the server took one millisecond or longer to write an outgoing request on an egress connection, counting from the instant when the connection establishes. .RE .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .SS DIAGNOSTIC PARAMETERS .PP To facilitate analysis of the MongoDB server behavior by MongoDB engineers, MongoDB logs server statistics to diagnostic files at periodic intervals. .PP For \fBmongod\f1\f1, the diagnostic data files are stored in the \fBdiagnostic.data\f1 directory under the \fBmongod\f1\f1 instance\(aqs \fB\-\-dbpath\f1 or \fBstorage.dbPath\f1\f1\&. .PP For \fBmongos\f1\f1, the diagnostic data files, by default, are stored in a directory under the \fBmongos\f1\f1 instance\(aqs \fB\-\-logpath\f1 or \fBsystemLog.path\f1\f1 directory. The diagnostic data directory is computed by truncating the logpath\(aqs file extension(s) and concatenating \fBdiagnostic.data\f1 to the remaining name. .PP For example, if \fBmongos\f1\f1 has \fB\-\-logpath /var/log/mongodb/mongos.log.201708015\f1, then the diagnostic data directory is \fB/var/log/mongodb/mongos.diagnostic.data/\f1 directory. To specify a different diagnostic data directory for \fBmongos\f1\f1, set the \fBdiagnosticDataCollectionDirectoryPath\f1\f1 parameter. .PP The following parameters support diagnostic data capture (FTDC): .PP 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. .PP \fBdiagnosticDataCollectionEnabled\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP Determines whether to enable the collecting and logging of data for diagnostic purposes. Diagnostic logging is enabled by default. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, the following disables the diagnostic collection: .PP .EX mongod \-\-setParameter diagnosticDataCollectionEnabled=false .EE .RE .PP \fBdiagnosticDataCollectionDirectoryPath\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: String .PP If \fBFull Time Diagnostic Data Capture (FTDC)\f1 is disabled with \fBdiagnosticDataCollectionEnabled\f1\f1 or if \fBsystemLog.destination\f1\f1 is set to \fBsyslog\f1, you must restart \fBmongos\f1\f1 after setting \fBdiagnosticDataCollectionDirectoryPath\f1\&. .PP Specify the directory for the diagnostic directory for \fBmongos\f1\f1\&. If the directory does not exist, \fBmongos\f1\f1 creates the directory. .PP If unspecified, the diagnostic data directory is computed by truncating the \fBmongos\f1\f1 instance\(aqs \fB\-\-logpath\f1 or \fBsystemLog.path\f1\f1 file extension(s) and concatenating \fBdiagnostic.data\f1\&. .PP For example, if \fBmongos\f1\f1 has \fB\-\-logpath /var/log/mongodb/mongos.log.201708015\f1, then the diagnostic data directory is \fB/var/log/mongodb/mongos.diagnostic.data/\f1\&. .PP If the \fBmongos\f1\f1 cannot create the specified directory, the diagnostic data capture is disabled for that instance. \fBmongos\f1\f1 may not be able to create the specified directory if a file with the same name already exists in the path or if the process does not have permissions to create the directory. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBdiagnosticDataCollectionDirectorySizeMB\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 200 .PP Specifies the maximum size, in megabytes, of the \fBdiagnostic.data\f1 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. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, the following sets the maximum size of the directory to \fB250\f1 megabytes: .PP .EX mongod \-\-setParameter diagnosticDataCollectionDirectorySizeMB=250 .EE .PP The minimum value for \fBdiagnosticDataCollectionDirectorySizeMB\f1\f1 is \fB10\f1 megabytes. \fBdiagnosticDataCollectionDirectorySizeMB\f1\f1 must be greater than maximum diagnostic file size \fBdiagnosticDataCollectionFileSizeMB\f1\f1\&. .RE .PP \fBdiagnosticDataCollectionFileSizeMB\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 10 .PP Specifies the maximum size, in megabytes, of each diagnostic file. If the file exceeds the maximum file size, MongoDB creates a new file. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, the following sets the maximum size of each diagnostic file to \fB20\f1 megabytes: .PP .EX mongod \-\-setParameter diagnosticDataCollectionFileSizeMB=20 .EE .PP The minimum value for \fBdiagnosticDataCollectionFileSizeMB\f1\f1 is \fB1\f1 megabyte. .RE .PP \fBdiagnosticDataCollectionPeriodMillis\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 1000 .PP Specifies the interval, in milliseconds, at which to collect diagnostic data. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, the following sets the interval to \fB5000\f1 milliseconds or 5 seconds: .PP .EX mongod \-\-setParameter diagnosticDataCollectionPeriodMillis=5000 .EE .PP The minimum value for \fBdiagnosticDataCollectionPeriodMillis\f1\f1 is \fB100\f1 milliseconds. .RE .SS REPLICATION AND CONSISTENCY .PP \fBdisableSplitHorizonIPCheck\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP \fIDefault\f1: false .PP To configure cluster nodes for split horizon DNS (https://en.wikipedia.org/wiki/Split\-horizon_DNS), use host names instead of IP addresses. .PP Starting in MongoDB v5.0, \fBreplSetInitiate\f1\f1 and \fBreplSetReconfig\f1\f1 reject configurations that use IP addresses instead of hostnames. .PP Use \fBdisableSplitHorizonIPCheck\f1\f1 to modify nodes that cannot be updated to use host names. The parameter only applies to the configuration commands. .PP \fBmongod\f1\f1 and \fBmongos\f1\f1 do not rely on \fBdisableSplitHorizonIPCheck\f1\f1 for validation at startup. Legacy \fBmongod\f1\f1 and \fBmongos\f1\f1 instances that use IP addresses instead of host names can start after an upgrade. .PP Instances that are configured with IP addresses log a warning to use host names instead of IP addresses. .PP To allow configuration changes using IP addresses, set \fBdisableSplitHorizonIPCheck=true\f1 using the command line: .PP .EX /usr/local/bin/mongod \-\-setParameter disableSplitHorizonIPCheck=true \-f /etc/mongod.conf .EE .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX setParameter: disableSplitHorizonIPCheck: true .EE .RE .PP \fBenableOverrideClusterChainingSetting\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP \fIDefault\f1: false .PP If \fBenableOverrideClusterChainingSetting\f1\f1 is \fBtrue\f1, replica set \fBsecondary\f1 members can replicate data from other secondary members even if \fBsettings.chainingAllowed\f1\f1 is \fBfalse\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to set the \fBenableOverrideClusterChainingSetting\f1\f1 for a \fBmongod\f1\f1 instance to \fBtrue\f1: .PP .EX mongod \-\-setParameter enableOverrideClusterChainingSetting=true .EE .RE .PP \fBlogicalSessionRefreshMillis\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 300000 (5 minutes) .PP The interval (in milliseconds) at which the cache refreshes its logical session records against the main session store. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to set the \fBlogicalSessionRefreshMillis\f1\f1 for a \fBmongod\f1\f1 instance to 10 minutes: .PP .EX mongod \-\-setParameter logicalSessionRefreshMillis=600000 .EE .RE .PP \fBlocalLogicalSessionTimeoutMinutes\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 30 .PP This parameter is intended for testing purposes only and not for production use. .PP The time in minutes that a \fBsession\f1 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\f1\f1 within this threshold are cleared from the cache. State associated with an expired session may be cleaned up by the server at any time. .PP 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. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to set the \fBlocalLogicalSessionTimeoutMinutes\f1\f1 for a test \fBmongod\f1\f1 instance to 20 minutes: .PP .EX mongod \-\-setParameter localLogicalSessionTimeoutMinutes=20 .EE .RE .PP \fBmaxAcceptableLogicalClockDriftSecs\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 31536000 (1 year) .PP The maximum amount by which the current cluster time can be advanced; specifically, \fBmaxAcceptableLogicalClockDriftSecs\f1\f1 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. .PP You cannot advance the cluster time to a new value if the new cluster time differs from the current cluster time by more than \fBmaxAcceptableLogicalClockDriftSecs\f1\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to set the \fBmaxAcceptableLogicalClockDriftSecs\f1\f1 for a \fBmongod\f1\f1 instance to 15 minutes: .PP .EX mongod \-\-setParameter maxAcceptableLogicalClockDriftSecs=900 .EE .RE .PP \fBmaxSessions\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 1000000 .PP The maximum number of sessions that can be cached. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to set the \fBmaxSessions\f1\f1 for a \fBmongod\f1\f1 instance to 1000: .PP .EX mongod \-\-setParameter maxSessions=1000 .EE .RE .PP \fBoplogBatchDelayMillis\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 0 .PP The number of milliseconds to delay applying batches of oplog operations on secondary nodes. By default, \fBoplogBatchDelayMillis\f1 is \fB0\f1, meaning oplog batches are applied with no delay. When there is no delay, MongoDB may apply frequent, small oplog batches to secondaries. .PP Increasing \fBoplogBatchDelayMillis\f1 causes MongoDB to apply oplog batches less frequently on secondaries, with each batch containing larger amounts of data. This reduces IOPS (Input/Output Operations Per Second) on secondaries, but adds latency for writes with write concern \fB"majority"\f1\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, run the following command to set the \fBoplogBatchDelayMillis\f1 for a \fBmongod\f1\f1 instance to 20 milliseconds: .PP .EX mongod \-\-setParameter oplogBatchDelayMillis=20 .EE .RE .PP \fBperiodicNoopIntervalSecs\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 10 .PP The duration in seconds between \fBnoop\f1 writes on each individual node. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP To modify this value for a MongoDB Atlas (https://www.mongodb.com/docs/atlas/) cluster, you must contact Atlas Support (https://www.mongodb.com/docs/atlas/support/)\&. .PP The following example sets the \fBperiodicNoopIntervalSecs\f1 to 1 second at startup: .PP .EX mongod \-\-setParameter periodicNoopIntervalSecs=1 .EE .RE .PP \fBstoreFindAndModifyImagesInSideCollection\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP Determines whether the temporary documents required for \fBretryable\f1 \fBfindAndModify\f1\f1 commands are stored in the \fIside\f1 collection (\fBconfig.image_collection\f1). .PP If \fBstoreFindAndModifyImagesInSideCollection\f1 is: .RS .IP \(bu 2 \fBtrue\f1, the temporary documents are stored in the side collection. .IP \(bu 2 \fBfalse\f1, the temporary documents are stored in the \fBreplica set oplog\f1\&. .RE .PP Keep \fBstoreFindAndModifyImagesInSideCollection\f1 set to \fBtrue\f1 if you: .RS .IP \(bu 2 Have a large \fBretryable\f1 \fBfindAndModify\f1\f1 workload. .IP \(bu 2 Require more temporary document space for \fBretryable\f1 \fBfindAndModify\f1\f1 commands than is available in the \fBreplica set oplog\f1\&. .RE .PP \fBSecondaries\f1 may experience increased CPU usage when \fBstoreFindAndModifyImagesInSideCollection\f1 is \fBtrue\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, to set \fBstoreFindAndModifyImagesInSideCollection\f1 to \fBfalse\f1 during startup: .PP .EX mongod \-\-setParameter storeFindAndModifyImagesInSideCollection=false .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, storeFindAndModifyImagesInSideCollection: false } ) .EE .RE .PP \fBTransactionRecordMinimumLifetimeMinutes\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 30 .PP The minimum lifetime a transaction record exists in the \fBtransactions\f1\f1 collection before the record becomes eligible for cleanup. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to set the \fBTransactionRecordMinimumLifetimeMinutes\f1\f1 for a \fBmongod\f1\f1 instance to 20 minutes: .PP .EX mongod \-\-setParameter TransactionRecordMinimumLifetimeMinutes=20 .EE .PP \fBlocalLogicalSessionTimeoutMinutes\f1\f1 .RE .PP \fBenableFlowControl\f1 .RS .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP 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\f1\f1 lag under a configurable maximum value. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For flow control to engage, the replica set/sharded cluster must have: \fBfeatureCompatibilityVersion (fCV)\f1 of \fB4.2\f1 and read concern \fBmajority enabled\f1\f1\&. That is, enabled flow control has no effect if fCV is not \fB4.2\f1 or if read concern majority is disabled. .RE .PP \fBflowControlTargetLagSeconds\f1 .RS .PP \fIType\f1: integer .PP \fIDefault\f1: 10 .PP The target maximum \fBmajority committed\f1\f1 lag when running with flow control. When flow control is enabled, the mechanism attempts to keep the \fBmajority committed\f1\f1 lag under the specified seconds. The parameter has no effect if flow control is disabled. .PP The specified value must be greater than 0. .PP 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. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBflowControlWarnThresholdSeconds\f1 .RS .PP \fIType\f1: integer .PP \fIDefault\f1: 10 .PP The amount of time to wait to log a warning once the flow control mechanism detects the majority commit point has not moved. .PP The specified value must be greater than or equal to 0, with 0 to disable warnings. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBinitialSyncTransientErrorRetryPeriodSeconds\f1 .RS .PP \fIType\f1: integer .PP \fIDefault\f1: 86400 .PP 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. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBinitialSyncSourceReadPreference\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: String .PP The preferred source for performing \fBinitial sync\f1\&. Specify one of the following read preference modes: .RS .IP \(bu 2 \fBprimary\f1\f1 .IP \(bu 2 \fBprimaryPreferred\f1\f1 (Default for voting replica set members) .IP \(bu 2 \fBsecondary\f1\f1 .IP \(bu 2 \fBsecondaryPreferred\f1\f1 .IP \(bu 2 \fBnearest\f1\f1 (Default for newly added \fIor\f1 non\-voting replica set members) .RE .PP If the replica set has disabled \fBchaining\f1\f1, the default \fBinitialSyncSourceReadPreference\f1\f1 read preference mode is \fBprimary\f1\f1\&. .PP You cannot specify a tag set or \fBmaxStalenessSeconds\f1 to \fBinitialSyncSourceReadPreference\f1\f1\&. .PP If the \fBmongod\f1\f1 cannot find a sync source based on the specified read preference, it logs an error and restarts the initial sync process. The \fBmongod\f1\f1 exits with an error if it cannot complete the initial sync process after \fB10\f1 attempts. For more information on sync source selection, see \fBInitial Sync Source Selection\f1\&. .PP \fBinitialSyncSourceReadPreference\f1\f1 takes precedence over the replica set\(aqs \fBsettings.chainingAllowed\f1\f1 setting when selecting an initial sync source. After a replica set member successfully completes initial sync, it defers to the value of \fBchainingAllowed\f1\f1 when selecting a replication sync source. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBinitialSyncMethod\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: String .PP \fIDefault\f1: \fBlogical\f1 .PP Available only in MongoDB Enterprise. .PP Method used for \fBinitial sync\f1\&. .PP Set to \fBlogical\f1 to use \fBlogical initial sync\f1\&. Set to \fBfileCopyBased\f1 to use \fBfile copy based initial sync\f1\&. .PP This parameter only affects the sync method for the member on which it is specified. Setting this parameter on a single replica set member does not affect the sync method of any other replica set members. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBmaxNumSyncSourceChangesPerHour\f1 .RS .PP \fIType\f1: integer .PP \fIDefault\f1: 3 .PP \fBSync sources\f1 are evaluated each time a sync source is updated and each time a node fetches a batch of oplog entries. If there are more than \fBmaxNumSyncSourceChangesPerHour\f1 source changes in an hour, the node temporarily stops re\-evaluating that sync source. If this parameter is set with a high value, the node may make unnecessary source changes. .PP This parameter will not prevent a node from starting to sync from another node if it doesn\(aqt have a sync source. The node will re\-evaluate if a sync source becomes invalid. Similarly, if the primary changes and chaining is disabled, the node will update to sync from the new primary. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBoplogFetcherUsesExhaust\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP Enables or disables \fBstreaming replication\f1\&. Set the value to \fBtrue\f1 to enable streaming replication. .PP Set the value to \fBfalse\f1 to disable streaming replication. If disabled, secondaries fetch batches of \fBoplog\f1 entries by issuing a request to their \fIsync from\f1 source and waiting for a response. This requires a network roundtrip for each batch of \fBoplog\f1 entries. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBoplogInitialFindMaxSeconds\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 60 .PP Maximum time in seconds for a member of a \fBreplica set\f1 to wait for the \fBfind\f1\f1 command to finish during \fBdata synchronization\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBreplWriterThreadCount\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 16 .PP Maximum number of threads to use to apply replicated operations in parallel. Values can range from 1 to 256 inclusive. However, the maximum number of threads used is capped at twice the number of available cores. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP \fBreplWriterMinThreadCount\f1\f1 .RE .PP \fBreplWriterMinThreadCount\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 0 .PP Minimum number of threads to use to apply replicated operations in parallel. Values can range from 0 to 256 inclusive. You can only set \fBreplWriterMinThreadCount\f1\f1 at startup and cannot change this setting with the \fBsetParameter\f1\f1 command. .PP Parallel application of replication operations uses up to \fBreplWriterThreadCount\f1\f1 threads. If \fBreplWriterMinThreadCount\f1\f1 is configured with a value less than \fBreplWriterThreadCount\f1\f1, the thread pool will timeout idle threads until the total count of threads in the thread pool is equal to \fBreplWriterMinThreadCount\f1\f1\&. .PP \fBreplWriterMinThreadCount\f1\f1 must be configured with a value that is less than or equal to \fBreplWriterThreadCount\f1\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBrollbackTimeLimitSecs\f1 .RS .PP \fIType\f1: 64\-bit integer .PP \fIDefault\f1: 86400 (1 day) .PP Maximum age of data that can be rolled back. Negative values for this parameter are not valid. .PP 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. .PP To effectively have an unlimited rollback period, set the value to \fB2147483647\f1 which is the maximum value allowed and equivalent to roughly 68 years. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .PP \fBwaitForSecondaryBeforeNoopWriteMS\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 10 .PP The length of time (in milliseconds) that a secondary must wait if the \fBafterClusterTime\f1 is greater than the last applied time from the oplog. After the \fBwaitForSecondaryBeforeNoopWriteMS\f1 passes, if the \fBafterClusterTime\f1 is still greater than the last applied time, the secondary makes a no\-op write to advance the last applied time. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets the \fBwaitForSecondaryBeforeNoopWriteMS\f1\f1 to 20 milliseconds: .PP .EX mongod \-\-setParameter waitForSecondaryBeforeNoopWriteMS=20 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, waitForSecondaryBeforeNoopWriteMS: 20 } ) .EE .RE .PP \fBcreateRollbackDataFiles\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP Flag that determines whether MongoDB creates \fBrollback files\f1 that contains documents affected during a rollback. .PP By default, \fBcreateRollbackDataFiles\f1\f1 is \fBtrue\f1 and MongoDB creates the rollback files. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBcreateRollbackDataFiles\f1\f1 to false so that the rollback files are not created: .PP .EX mongod \-\-setParameter createRollbackDataFiles=false .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, createRollbackDataFiles: false } ) .EE .PP For more information, see \fBCollect Rollback Data\f1\&. .RE .PP \fBreplBatchLimitBytes\f1 .RS .PP \fIDefault\f1: 104857600 (100MB) .PP Sets the maximum oplog application batch size in bytes. .PP Values can range from 16777216 (16MB) to 104857600 (100MB) inclusive. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBreplBatchLimitBytes\f1\f1 to 64 MB to limit the oplog application batch size: .PP .EX mongod \-\-setParameter replBatchLimitBytes=67108864 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, replBatchLimitBytes: 64 * 1024 * 1024 } ) .EE .RE .PP \fBmirrorReads\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: Document .PP \fIDefault\f1: \fB{ samplingRate: 0.01, maxTimeMS: 1000 }\f1 .PP Specifies the settings for \fBmirrored reads\f1 for the \fBmongod\f1\f1 instance. The settings only take effect when the member is a primary. .PP The parameter \fBmirrorReads\f1\f1 takes a JSON document with the following fields: .RS .IP \(bu 2 .RS .IP \(bu 4 Field .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 \fBsamplingRate\f1 .IP \(bu 4 The sampling rate used to mirror a subset of \fBoperations that support mirroring\f1 to a subset of electable (specifically, \fBpriority greater than 0\f1\f1) secondaries. That is, the primary mirrors reads to each electable secondary at the specified sampling rate. .IP Valid values are: .RS .IP \(bu 6 .RS .IP \(bu 8 \fB0.0\f1 .IP \(bu 8 Turns off mirroring. .RE .IP \(bu 6 .RS .IP \(bu 8 \fB1.0\f1 .IP \(bu 8 The primary mirrors all \fBoperations that supports mirroring\f1 to each electable secondary. .RE .IP \(bu 6 .RS .IP \(bu 8 Number between \fB0.0\f1 and \fB1.0\f1 (exclusive) .IP \(bu 8 The primary randomly samples each electable secondary at the specified rate to be sent mirrored reads. .RE .RE .IP For example, given a replica set with a primary and two electable secondaries and a sampling rate of \fB0.10\f1, 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\f1 operations that can be mirrored, the sampling rate of \fB0.10\f1 may result in \fB8\f1 reads being mirrored to one secondary and \fB13\f1 reads to the other or \fB10\f1 to each, etc. .IP The default value is \fB0.01\f1\&. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBmaxTimeMS\f1 .IP \(bu 4 The maximum time in milliseconds for the mirrored reads. The default value is \fB1000\f1\&. .IP The \fBmaxTimeMS\f1 for the mirrored reads is separate from the \fBmaxTimeMS\f1 of the original read being mirrored. .RE .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP If you specify from the configuration file or on the command line, \fBenclose the\f1 \fBmirrorReads\f1 \fBdocument in quotes\f1\&. .PP For example, the following sets the mirror reads sampling rate to \fB0.10\f1 from the command line: .PP .EX mongod \-\-setParameter mirrorReads=\(aq{ samplingRate: 0.10 }\(aq .EE .PP Or, to specify in a configuration file: .PP .EX setParameter: mirrorReads: \(aq{samplingRate: 0.10}\(aq .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongod\f1\f1, do \fBnot\f1 enclose the document in quotes: .PP .EX db.adminCommand( { setParameter: 1, mirrorReads: { samplingRate: 0.10 } } ) .EE .RE .PP \fBallowMultipleArbiters\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: false .PP Specifies whether the replica set allows the use of multiple arbiters. .PP The use of multiple arbiters is not recommended: .RS .IP \(bu 2 Multiple arbiters prevent the reliable use of the majority write concern. MongoDB counts arbiters in calculating a membership majority, but arbiters do not store data. With the inclusion of multiple arbiters, it\(aqs possible for a majority write operation to return success before the write replicates to a majority of data bearing nodes. .IP \(bu 2 Multiple arbiters allow replica sets to accept writes even when the replica set doesn\(aqt have sufficient secondaries for data replication. .RE .PP For more information, see \fBConcerns with Multiple Arbiters\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX mongod \-\-setParameter allowMultipleArbiters=true .EE .RE .SS SHARDING PARAMETERS .PP \fBanalyzeShardKeyCharacteristicsDefaultSampleSize\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 10000000 .PP If \fBsampleRate\f1 and \fBsampleSize\f1 are not set when you run \fBanalyzeShardKey\f1, specifies the number of documents to sample when calculating shard key characteristics metrics. Must be greater than \fB0\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBanalyzeShardKeyCharacteristicsDefaultSampleSize\f1 to \fB10000\f1 at startup: .PP .EX mongod \-\-setParameter analyzeShardKeyCharacteristicsDefaultSampleSize=10000 .EE .PP During run time, you can set or modify the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, analyzeShardKeyCharacteristicsDefaultSampleSize: 10000 } ) .EE .RE .PP \fBanalyzeShardKeyNumMostCommonValues\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 5 .PP Specifies the number of most common shard key values to return. If the collection contains fewer unique shard keys than this value, \fBanalyzeShardKeyNumMostCommonValues\f1 returns that number of most common values. Must be greater than \fB0\f1 and less than or equal to \fB1000\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBanalyzeShardKeyNumMostCommonValues\f1 to \fB3\f1 at startup: .PP .EX mongod \-\-setParameter analyzeShardKeyNumMostCommonValues=3 .EE .PP During run time, you can set or modify the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, analyzeShardKeyNumMostCommonValues: 3 } ) .EE .RE .PP \fBanalyzeShardKeyNumRanges\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 100 .PP Specifies the number of ranges to partition the shard key space into when calculating the \fBhotness\f1 of shard key ranges. Must be greater than \fB0\f1 and less than or equal to \fB10000\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBanalyzeShardKeyNumRanges\f1 to \fB50\f1 at startup: .PP .EX mongod \-\-setParameter analyzeShardKeyNumRanges=50 .EE .PP During run time, you can set or modify the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, analyzeShardKeyNumRanges: 50 } ) .EE .RE .PP \fBanalyzeShardKeyMonotonicityCorrelationCoefficientThreshold\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: double .PP \fIDefault\f1: 0.7 .PP Specifies the \fBRecordId\f1 correlation coefficient threshold used to determine if a shard key is monotonically changing in insertion order. Must be greater than \fB0\f1 and less than or equal to \fB1\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBanalyzeShardKeyMonotonicityCorrelationCoefficientThreshold\f1 to \fB1\f1 at startup: .PP .EX mongod \-\-setParameter analyzeShardKeyMonotonicityCorrelationCoefficientThreshold=1 .EE .PP During run time, you can set or modify the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, analyzeShardKeyMonotonicityCorrelationCoefficientThreshold: 1 } ) .EE .RE .PP \fBautoMergerIntervalSecs\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 3600 .PP When AutoMerger is enabled, specifies the amount of time between automerging rounds, in seconds. The default value is 3600 seconds, or one hour. .PP \fBautoMergerIntervalSecs\f1 can only be set on config servers. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBautoMergerIntervalSecs\f1 to 7200 seconds, or two hours, at startup: .PP .EX mongod \-\-setParameter autoMergerIntervalSecs=7200 .EE .PP During run time, you can set or modify the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, autoMergerIntervalSecs: 7200 } ) .EE .RE .PP \fBautoMergerThrottlingMS\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 15000 .PP When AutoMerger is enabled, specifies the minimum amount time between merges initiated by the AutoMerger on the same collection, in milliseconds. .PP \fBautoMergerThrottlingMS\f1 can only be set on config servers. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBautoMergerThrottlingMS\f1 to 60000 milliseconds, or one minute, at startup: .PP .EX mongod \-\-setParameter autoMergerThrottlingMS=60000 .EE .PP During run time, you can set or modify the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, autoMergerThrottlingMS: 60000 } ) .EE .RE .PP \fBbalancerMigrationsThrottlingMs\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 1000 .PP Specifies the minimum amount of time between two consecutive balancing rounds. This allows you to throttle the balancing rate. This parameter only takes effect on config server nodes. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBbalancerMigrationsThrottlingMs\f1 to 2000 milliseconds at startup: .PP .EX mongod \-\-setParameter balancerMigrationsThrottlingMs=2000 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, balancerMigrationsThrottlingMs: 2000 } ) .EE .RE .PP \fBchunkDefragmentationThrottlingMS\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 0 .PP Specifies the minimum time period (in milliseconds) between consecutive split and merge commands run by the \fBbalancer\f1 when the \fBchunks\f1 in a \fBsharded\f1 collection are defragmented. \fBchunkDefragmentationThrottlingMS\f1\f1 limits the rate of split and merge commands. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBchunkDefragmentationThrottlingMS\f1\f1 to \fB10\f1 milliseconds: .PP .EX mongod \-\-setParameter chunkDefragmentationThrottlingMS=10 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, chunkDefragmentationThrottlingMS: 10 } ) .EE .RE .PP \fBchunkMigrationConcurrency\f1 .RS .PP \fIAvailable starting in MongoDB 7.0, 6.3, 6.0.6 (and 5.0.15).\f1 .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 1 .PP Specifies an integer that sets the number of threads on the source shard and the receiving shard for \fBchunk migration\f1\&. Chunk migrations use the number of threads that you set on the receiving shard for both the source and receiving shard. .PP Increasing the concurrency improves chunk migration performance, but also increases the workload and disk IOPS usage on the source shard and the receiving shard. .PP Maximum value is 500. .PP You should typically use half the total number of CPU cores as threads. For example, if the total is 16 cores, set \fBchunkMigrationConcurrency\f1 to 8 threads (or fewer). .PP If \fBchunkMigrationConcurrency\f1 is greater than \fB1\f1, the \fB_secondaryThrottle\f1 configuration setting is ignored. The \fB_secondaryThrottle\f1 setting determines when the chunk migration proceeds with the next document in the chunk. For details, see \fBRange Migration and Replication\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBchunkMigrationConcurrency\f1 to \fB5\f1: .PP .EX mongod \-\-setParameter chunkMigrationConcurrency=5 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, chunkMigrationConcurrency: 5 } ) .EE .PP To configure collection balancing, see \fBconfigureCollectionBalancing\f1\f1\&. .PP To learn about defragmenting sharded collections, see \fBDefragment Sharded Collections\f1\&. .RE .PP \fBdisableResumableRangeDeleter\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: false .PP If set on a shard\(aqs primary, specifies if range deletion is paused on the shard. If set to \fBtrue\f1, cleanup of \fBranges\f1 containing \fBorphaned documents\f1 is paused. The shard can continue to donate chunks to other shards, but the donated documents will not be removed from this shard until you set this parameter to \fBfalse\f1\&. This shard can continue to receive chunks from other shards as long as it does not have a pending range deletion task in the \fBconfig.rangeDeletions\f1\f1 collection that overlaps with the incoming chunk\(aqs range. .PP When \fBdisableResumableRangeDeleter\f1\f1 is \fBtrue\f1, chunk migrations fail if \fBorphaned documents\f1 exist on the recipient shard\(aqs primary in the same range as the incoming chunks. .PP The parameter has no effect on the \fBmongod\f1\f1 if it is not the shard\(aqs primary. .PP If you set \fBdisableResumableRangeDeleter\f1\f1 parameter to \fBtrue\f1, ensure that you apply it consistently for all members in the shard\(aqs replica set. In the event of a failover, this setting\(aqs value on the new primary dictates the behavior of the range deleter. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX mongod \-\-setParameter disableResumableRangeDeleter=false .EE .RE .PP \fBenableShardedIndexConsistencyCheck\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP 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\f1\f1 if it is not the config server\(aqs primary. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBenableShardedIndexConsistencyCheck\f1\f1 to \fBfalse\f1 for a config server primary: .PP .EX mongod \-\-setParameter enableShardedIndexConsistencyCheck=false .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, enableShardedIndexConsistencyCheck: false } ) .EE .RS .IP \(bu 2 \fBshardedIndexConsistencyCheckIntervalMS\f1\f1 parameter .IP \(bu 2 \fBshardedIndexConsistency\f1\f1 metrics returned by the \fBserverStatus\f1\f1 command. .RE .RE .PP \fBopportunisticSecondaryTargeting\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: boolean .PP \fIDefault\f1: \fBfalse\f1 .PP Determines whether \fBmongos\f1 performs opportunistic reads against replica sets. .PP When this parameter is set to \fBtrue\f1, \fBmongos\f1\f1 directs secondary reads to secondaries with active connections. It sends the request to the first secondary that accepts the connection. When this parameter is set to \fBfalse\f1, \fBmongos\f1\f1 holds secondary reads until it can establish a connection to a specific secondary, (except in the case of \fBhedged reads\f1). .PP Under certain workloads, opportunistic reads may trigger the opening of unnecessary connections from \fBmongos\f1\f1 to \fBmongod\f1\f1 and reduce overall performance. This parameter should not be enabled unless your application has a specific need for the feature. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, to set \fBopportunisticSecondaryTargeting\f1 during startup: .PP .EX mongos \-\-setParameter opportunisticSecondaryTargeting=true .EE .RE .PP \fBshardedIndexConsistencyCheckIntervalMS\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 600000 .PP 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\f1\f1 if it is not the config server\(aqs primary. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, the following sets the interval at 300000 milliseconds (5 minutes) at startup: .PP .EX mongod \-\-setParameter shardedIndexConsistencyCheckIntervalMS=300000 .EE .RS .IP \(bu 2 \fBenableShardedIndexConsistencyCheck\f1\f1 parameter .IP \(bu 2 \fBshardedIndexConsistency\f1\f1 metrics returned by the \fBserverStatus\f1\f1 commandq .RE .RE .PP \fBenableFinerGrainedCatalogCacheRefresh\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: boolean .PP \fIDefault\f1: true .PP This parameter allows the catalog cache to be refreshed only if the shard needs to be refreshed. If disabled, any stale chunk will cause the entire chunk distribution for a collection to be considered stale and force all \fBrouters\f1 who contact the shard to refresh their shard catalog cache. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX mongod \-\-setParameter enableFinerGrainedCatalogCacheRefresh=true mongos \-\-setParameter enableFinerGrainedCatalogCacheRefresh=true .EE .RS .IP \(bu 2 \fBSharding\f1 .IP \(bu 2 \fBshardingStatistics.catalogCache\f1\f1 .RE .RE .PP \fBmaxTimeMSForHedgedReads\f1 .RS .PP Starting in MongoDB 8.0, hedged reads are deprecated. Queries that specify the read preference \fBnearest\f1\f1 no longer use hedged reads by default. If you explicitly specify a hedged read, MongoDB performs a hedged read and logs a warning. .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 150 .PP Specifies the maximum time limit (in milliseconds) for the \fBhedged read\f1\&. That is, the additional read sent to hedge the read operation uses the \fBmaxTimeMS\f1 value of \fBmaxTimeMSForHedgedReads\f1\f1 while the read operation that is being hedged uses the \fBmaxTimeMS\f1 value specified for the operation. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, to set the limit to 200 milliseconds, you can issue the following during startup: .PP .EX mongos \-\-setParameter maxTimeMSForHedgedReads=200 .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongos\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, maxTimeMSForHedgedReads: 200 } ) .EE .RS .IP \(bu 2 \fBreadHedgingMode\f1\f1 .IP \(bu 2 \fBHedged Reads\f1 .RE .RE .PP \fBmaxCatchUpPercentageBeforeBlockingWrites\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 10 .PP For \fBmoveChunk\f1\f1 and \fBmoveRange\f1\f1 operations, specifies the maximum percentage of untrasferred data allowed by the migration protocol (expressed in percentage of the total chunk size) to transition from the \fBcatchup\f1 phase to the \fBcommit\f1 phase. .PP Setting a higher catchup percentage can decrease the amount of time it takes for the migration to complete at the cost of increased latency during concurrent \fBupsert\f1\f1 and \fBdelete\f1\f1 operations. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP Starting in MongoDB 7.1 (and 7.0.1), you can set the parameter during runtime. .PP For example, to set the maximum percentage to 20, you can issue the following during startup: .PP .EX mongod \-\-setParameter maxCatchUpPercentageBeforeBlockingWrites=20 .EE .PP Starting in MongoDB 7.1 (and 7.0.1), you can set the parameter during runtime with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, maxCatchUpPercentageBeforeBlockingWrites: 20} ) .EE .PP Live Migration Protocol (https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/README.md#the\-live\-migration\-protocol) .RE .PP \fBmetadataRefreshInTransactionMaxWaitBehindCritSecMS\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 500 .PP Limits the time a shard waits for a critical section within a transaction. .PP When a query accesses a shard, a \fBchunk migration\f1 or \fBDDL operation\f1 may already hold the critical section for the collection. If the query finds the critical section is taken, the shard waits until the critical section has been released. When the shard returns control to \fBmongos\f1\f1, \fBmongos\f1\f1 retries the query. However, if a multi\-shard transaction interacts with an operation that takes the critical section on multiple shards, the interaction can result in a distributed deadlock. .PP \fBmetadataRefreshInTransactionMaxWaitBehindCritSecMS\f1\f1 limits the maximum time a shard waits within a transaction for the critical section to be released. .PP To reduce the maximum wait time for the critical section within a transaction, lower the value of \fBmetadataRefreshInTransactionMaxWaitBehindCritSecMS\f1\f1\&. .PP If \fBmetadataRefreshInTransactionMaxWaitBehindCritSecMS\f1\f1 is too low, \fBmongos\f1\f1 could use all of its retry attempts and return an error. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, to set \fBmetadataRefreshInTransactionMaxWaitBehindCritSecMS\f1\f1 to 400 milliseconds: .PP .EX db.adminCommand( { setParameter: 1, metadataRefreshInTransactionMaxWaitBehindCritSecMS: 400 } ) .EE .RE .PP \fBqueryAnalysisSamplerConfigurationRefreshSecs\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 10 .PP Interval that a sampler (\fBmongos\f1 or \fBmongod\f1) refreshes its query analyzer sample rates. .PP The sample rate configured by the \fBconfigureQueryAnalyzer\f1 command is divided among \fBmongos\f1 instances in the sharded cluster or \fBmongod\f1 instances in the replica set based on the traffic going through them. To make the sample rate assignment for a \fBmongos\f1 or \fBmongod\f1 more responsive to the traffic going through it, decrease this value. .PP We recommend using the default value. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP Starting in MongoDB 7.0.1, you can set \fBqueryAnalysisSamplerConfigurationRefreshSecs\f1 during run time. .PP This example sets \fBqueryAnalysisSamplerConfigurationRefreshSecs\f1 to 60 seconds at startup on a \fBmongod\f1 instance: .PP .EX mongod \-\-setParameter queryAnalysisSamplerConfigurationRefreshSecs=60 .EE .PP This example sets \fBqueryAnalysisSamplerConfigurationRefreshSecs\f1 to 60 seconds at startup on a \fBmongos\f1 instance: .PP .EX mongos \-\-setParameter queryAnalysisSamplerConfigurationRefreshSecs=60 .EE .PP To set the value to 30 seconds, run the following: .PP .EX db.adminCommand( { setParameter: 1, queryAnalysisSamplerConfigurationRefreshSecs: 30 } ) .EE .RE .PP \fBqueryAnalysisWriterIntervalSecs\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 90 .PP Interval that sampled queries are written to disk, in seconds. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP Starting in MongoDB 7.0.1, you can set \fBqueryAnalysisWriterIntervalSecs\f1 during run time. .PP This example sets \fBqueryAnalysisWriterIntervalSecs\f1 to 60 seconds at startup on a \fBmongod\f1 instance: .PP .EX mongod \-\-setParameter queryAnalysisWriterIntervalSecs=60 To set the value to 60 seconds, run the following: .EE .PP .EX db.adminCommand( { setParameter: 1, queryAnalysisWriterIntervalSecs: 60 } ) .EE .RE .PP \fBqueryAnalysisWriterMaxMemoryUsageBytes\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 100 * 1024 * 1024 .PP Maximum amount of memory in bytes that the query sampling writer is allowed to use. Once the limit is reached, all new queries and diffs are discarded from sampling until the buffer is flushed. Must be greater than \fB0\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBqueryAnalysisWriterMaxMemoryUsageBytes\f1 to \fB10000000\f1 at startup on a \fBmongod\f1 instance: .PP .EX mongod \-\-setParameter queryAnalysisWriterMaxMemoryUsageBytes=10000000 .EE .RE .PP \fBqueryAnalysisWriterMaxBatchSize\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 100000 .PP Maximum number of sampled queries to write to disk at once. Must be greater than \fB0\f1 and less than or equal to \fB100000\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBqueryAnalysisWriterMaxBatchSize\f1 to \fB1000\f1 at startup on a \fBmongod\f1 instance: .PP .EX mongod \-\-setParameter queryAnalysisWriterMaxBatchSize=1000 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, queryAnalysisWriterMaxBatchSize: 1000 } ) .EE .RE .PP \fBqueryAnalysisSampleExpirationSecs\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 7 * 24 * 3600 .PP Amount of time that a sampled query document exists before being removed by the TTL monitor, in seconds. Must be greater than \fB0\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP This example sets \fBqueryAnalysisSampleExpirationSecs\f1 to \fB691200\f1 (\fB8 * 24 * 3600\f1) at startup on a \fBmongod\f1 instance: .PP .EX mongod \-\-setParameter queryAnalysisSampleExpirationSecs=691200 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, queryAnalysisSampleExpirationSecs: 691200 } ) .EE .RE .PP \fBreadHedgingMode\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: string .PP \fIDefault\f1: on .PP Specifies whether \fBmongos\f1\f1 supports hedged reads for those read operations whose \fBread preference\f1 have enabled the hedged read option. .PP Available values are: .RS .IP \(bu 2 .RS .IP \(bu 4 Value .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 \fBon\f1 .IP \(bu 4 The \fBmongos\f1\f1 instance supports hedged reads for read operations whose \fBread preference\f1 have enabled the hedged read option. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBoff\f1 .IP \(bu 4 The \fBmongos\f1\f1 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. .RE .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, to turn off hedged read support for a \fBmongos\f1\f1 instance, you can issue the following during startup: .PP .EX mongos \-\-setParameter readHedgingMode=off .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongos\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, readHedgingMode: "off" } ) .EE .RS .IP \(bu 2 \fBHedged Reads\f1 .IP \(bu 2 \fBmaxTimeMSForHedgedReads\f1\f1 .RE .RE .PP \fBroutingTableCacheChunkBucketSize\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP \fIType\f1: integer .PP \fIDefault\f1: 500 .PP Specifies the size of the routing table cache buckets used to implement chunk grouping optimization. Must be greater than \fB0\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP For example, to set the cache chunk bucket size to \fB250\f1 on a \fBmongod\f1, issue the following command at startup: .PP .EX mongod \-\-setParameter routingTableCacheChunkBucketSize=250 .EE .RE .PP \fBshutdownTimeoutMillisForSignaledShutdown\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 15000 .PP Specifies the time (in milliseconds) to wait for any ongoing database operations to complete before initiating a shutdown of \fBmongod\f1\f1 in response to a \fBSIGTERM\f1 signal. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, to set the time to 250 milliseconds, you can issue the following during startup: .PP .EX mongod \-\-setParameter shutdownTimeoutMillisForSignaledShutdown=250 .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongod\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, shutdownTimeoutMillisForSignaledShutdown: 250 } ) .EE .RE .PP \fBmongosShutdownTimeoutMillisForSignaledShutdown\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 15000 .PP Specifies the time (in milliseconds) to wait for any ongoing database operations to complete before initiating a shutdown of \fBmongos\f1\f1 in response to a \fBSIGTERM\f1 signal. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, to set the time to 250 milliseconds, you can issue the following during startup: .PP .EX mongos \-\-setParameter mongosShutdownTimeoutMillisForSignaledShutdown=250 .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongos\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, mongosShutdownTimeoutMillisForSignaledShutdown: 250 } ) .EE .RE .PP \fBShardingTaskExecutorPoolHostTimeoutMS\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: integer .PP Default: 300000 (5 minutes) .PP Maximum time that \fBmongos\f1\f1 goes without communication to a host before \fBmongos\f1\f1 drops all connections to the host. .PP If set, \fBShardingTaskExecutorPoolHostTimeoutMS\f1\f1 should be greater than the sum of \fBShardingTaskExecutorPoolRefreshRequirementMS\f1\f1 and \fBShardingTaskExecutorPoolRefreshTimeoutMS\f1\f1\&. Otherwise, \fBmongos\f1\f1 adjusts the value of \fBShardingTaskExecutorPoolHostTimeoutMS\f1\f1 to be greater than the sum. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBShardingTaskExecutorPoolHostTimeoutMS\f1\f1 to \fB120000\f1 during startup: .PP .EX mongos \-\-setParameter ShardingTaskExecutorPoolHostTimeoutMS=120000 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolHostTimeoutMS: 120000 } ) .EE .RE .PP \fBShardingTaskExecutorPoolMaxConnecting\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: integer .PP Default: 2 .PP Maximum number of simultaneous initiating connections (including pending connections in setup/refresh state) each TaskExecutor connection pool can have to a \fBmongod\f1\f1 instance. You can set this parameter to control the rate at which \fBmongos\f1\f1 adds connections to a \fBmongod\f1\f1 instance. .PP If set, \fBShardingTaskExecutorPoolMaxConnecting\f1\f1 should be less than or equal to \fBShardingTaskExecutorPoolMaxSize\f1\f1\&. If it is greater, \fBmongos\f1\f1 ignores the \fBShardingTaskExecutorPoolMaxConnecting\f1\f1 value. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBShardingTaskExecutorPoolMaxConnecting\f1\f1 to \fB20\f1 during startup: .PP .EX mongos \-\-setParameter ShardingTaskExecutorPoolMaxConnecting=20 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolMaxConnecting: 20 } ) .EE .RE .PP \fBShardingTaskExecutorPoolMaxSize\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: integer .PP Default: 2 64 \- 1 .PP Maximum number of outbound connections each TaskExecutor connection pool can open to any given \fBmongod\f1\f1 instance. The maximum possible connections to any given host across all TaskExecutor pools is: .PP .EX ShardingTaskExecutorPoolMaxSize * taskExecutorPoolSize .EE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBShardingTaskExecutorPoolMaxSize\f1\f1 to \fB20\f1 during startup: .PP .EX mongos \-\-setParameter ShardingTaskExecutorPoolMaxSize=20 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolMaxSize: 20 } ) .EE .PP \fBmongos\f1\f1 can have up to \fBn\f1 TaskExecutor connection pools, where \fBn\f1 is the number of cores. See \fBtaskExecutorPoolSize\f1\f1\&. .PP \fBShardingTaskExecutorPoolMinSize\f1\f1 .RE .PP \fBShardingTaskExecutorPoolMaxSizeForConfigServers\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: integer .PP Default: \-1 .PP Optional override for \fBShardingTaskExecutorPoolMaxSize\f1\f1 to set the maximum number of outbound connections each TaskExecutor connection pool can open to a \fBconfiguration server\f1\&. .PP When set to: .RS .IP \(bu 2 \fB\-1\f1, \fBShardingTaskExecutorPoolMaxSize\f1\f1 is used. This is the default. .IP \(bu 2 an integer value greater than \fB\-1\f1, overrides the maximum number of outbound connections each TaskExecutor connection pool can open to a configuration server. .RE .PP Parameter only applies to sharded deployments. .PP The following example sets \fBShardingTaskExecutorPoolMaxSize\f1\f1 to \fB2\f1 during startup, which sets the maximum number of outbound connections each TaskExecutor connection pool can open to a configuration server to \fB2\f1: .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX mongos \-\-setParameter ShardingTaskExecutorPoolMaxSizeForConfigServers=2 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolMaxSizeForConfigServers: 2 } ) .EE .RE .PP \fBShardingTaskExecutorPoolMinSize\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: integer .PP Default: 1 .PP Minimum number of outbound connections each TaskExecutor connection pool can open to any given \fBmongod\f1\f1 instance. .PP \fBShardingTaskExecutorPoolMinSize\f1 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 \fBShardingTaskExecutorPoolHostTimeoutMS\f1\f1 milliseconds pass without any application using that pool. .PP For a \fBmongos\f1\f1 using the \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartup\f1\f1 parameter, the \fBShardingTaskExecutorPoolMinSize\f1 parameter also controls how many connections to each shard host are established on startup of the \fBmongos\f1\f1 instance before it begins accepting incoming client connections. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBShardingTaskExecutorPoolMinSize\f1\f1 to \fB2\f1 during startup: .PP .EX mongos \-\-setParameter ShardingTaskExecutorPoolMinSize=2 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolMinSize: 2 } ) .EE .PP \fBmongos\f1\f1 can have up to \fBn\f1 TaskExecutor connection pools, where \fBn\f1 is the number of cores. See \fBtaskExecutorPoolSize\f1\f1\&. .RS .IP \(bu 2 \fBShardingTaskExecutorPoolMaxSize\f1\f1 .IP \(bu 2 \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartup\f1\f1 .RE .RE .PP \fBShardingTaskExecutorPoolMinSizeForConfigServers\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: integer .PP Default: \-1 .PP Optional override for \fBShardingTaskExecutorPoolMinSize\f1\f1 to set the minimum number of outbound connections each TaskExecutor connection pool can open to a \fBconfiguration server\f1\&. .PP When set to: .RS .IP \(bu 2 \fB\-1\f1, \fBShardingTaskExecutorPoolMinSize\f1\f1 is used. This is the default. .IP \(bu 2 an integer value greater than \fB\-1\f1, overrides the minimum number of outbound connections each TaskExecutor connection pool can open to a configuration server. .RE .PP Parameter only applies to sharded deployments. .PP The following example sets \fBShardingTaskExecutorPoolMinSize\f1\f1 to \fB2\f1 during startup, which sets the minimum number of outbound connections each TaskExecutor connection pool can open to a configuration server to \fB2\f1: .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX mongos \-\-setParameter ShardingTaskExecutorPoolMinSizeForConfigServers=2 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolMinSizeForConfigServers: 2 } ) .EE .RE .PP \fBShardingTaskExecutorPoolRefreshRequirementMS\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: integer .PP Default: 60000 (1 minute) .PP Maximum time the \fBmongos\f1\f1 waits before attempting to heartbeat an idle connection in the pool. An idle connection may be discarded during the refresh if the pool is above its \fBminimum size\f1\&. .PP If set, \fBShardingTaskExecutorPoolRefreshRequirementMS\f1\f1 should be greater than \fBShardingTaskExecutorPoolRefreshTimeoutMS\f1\f1\&. Otherwise, \fBmongos\f1\f1 adjusts the value of \fBShardingTaskExecutorPoolRefreshTimeoutMS\f1\f1 to be less than \fBShardingTaskExecutorPoolRefreshRequirementMS\f1\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBShardingTaskExecutorPoolRefreshRequirementMS\f1\f1 to \fB90000\f1 during startup: .PP .EX mongos \-\-setParameter ShardingTaskExecutorPoolRefreshRequirementMS=90000 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolRefreshRequirementMS: 90000 } ) .EE .RE .PP \fBShardingTaskExecutorPoolRefreshTimeoutMS\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: integer .PP Default: 20000 (20 seconds) .PP Maximum time the \fBmongos\f1\f1 waits for a heartbeat before timing out the heartbeat. .PP If set, \fBShardingTaskExecutorPoolRefreshTimeoutMS\f1\f1 should be less than \fBShardingTaskExecutorPoolRefreshRequirementMS\f1\f1\&. Otherwise, \fBmongos\f1\f1 adjusts the value of \fBShardingTaskExecutorPoolRefreshTimeoutMS\f1\f1 to be less than \fBShardingTaskExecutorPoolRefreshRequirementMS\f1\f1\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBShardingTaskExecutorPoolRefreshTimeoutMS\f1\f1 to \fB30000\f1 during startup: .PP .EX mongos \-\-setParameter ShardingTaskExecutorPoolRefreshTimeoutMS=30000 .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolRefreshTimeoutMS: 30000 } ) .EE .RE .PP \fBShardingTaskExecutorPoolReplicaSetMatching\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: string .PP Default: "automatic" .PP On a \fBmongos\f1\f1 instance, this parameter sets the policy that determines the minimum size limit of its connection pools to nodes within replica sets. .PP On a \fBmongod\f1\f1 instance, this parameter sets the policy that determines the minimum size limit of its connection pools to nodes within \fIother\f1 replica sets. .PP Note that this parameter only manages connections for operations that are directly related to user requests and CRUD operations. .PP Available values are: .RS .IP \(bu 2 .RS .IP \(bu 4 Matching Policy .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 \fB"automatic"\f1 (Default) .IP \(bu 4 Starting in 5.0, \fB"automatic"\f1 is the new default value. .IP When set for a \fBmongos\f1\f1, the instance follows the behavior specified for the \fB"matchPrimaryNode"\f1 option. .IP When set for a \fBmongod\f1\f1, the instance follows the behavior specified for the \fB"disabled"\f1 option. .IP If the \fBShardingTaskExecutorPoolReplicaSetMatching\f1\f1 is set to \fB"automatic"\f1, the \fBreplicaSetMatchingStrategy\f1\f1 still describes the actual policy being used, not \fB"automatic"\f1\&. To find the value of the \fBShardingTaskExecutorPoolReplicaSetMatching\f1\f1, use \fBgetParameter\f1\f1 which returns the value of the server parameter. .RE .IP \(bu 2 .RS .IP \(bu 4 \fB"matchPrimaryNode"\f1 .IP \(bu 4 When set for a \fBmongos\f1\f1, the minimum size limit of the instance\(aqs connection pool to each secondary of a replica set in the sharded cluster (specifically, shard replica set and config servers) is equal to the size of its connection pool to that replica set\(aqs primary. .IP When set for a \fBmongod\f1\f1, the minimum size limit of the instance\(aqs connection pool to each secondary of another replica set in the sharded cluster (specifically, shard replica set and config servers) is equal to the size of its connection pool to that replica set\(aqs primary. .IP If multiple shard servers in your topology can experience a rapid influx of cross\-shard operations, do not set this option on your \fBmongod\f1\f1 instances. .IP In case of a primary stepdown, \fBmatchPrimaryNode\f1 ensures that any secondary that becomes the primary can handle the current level of primary reads and writes. .RE .IP \(bu 2 .RS .IP \(bu 4 \fB"matchBusiestNode"\f1 .IP \(bu 4 When set for a \fBmongos\f1\f1, the instance\(aqs minimum size limit of the connection pool to each member of a replica set in the sharded cluster (specifically, shard replica set and config servers) is equal to the largest among the active connection counts to the primary and each secondary member of that replica set. .IP When set for a \fBmongod\f1\f1, the instance\(aqs minimum size limit of the connection pool to each member of another replica set in the sharded cluster (specifically, shard replica set and config servers) is equal to the largest among the active connection counts to the primary and each secondary member of that replica set. .IP With \fB"matchBusiestNode"\f1, \fBmongos\f1\f1 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. .RE .IP \(bu 2 .RS .IP \(bu 4 \fB"disabled"\f1 .IP \(bu 4 When set for a \fBmongos\f1\f1, the instance\(aqs minimum number of connections in the instance\(aqs connection pool to each node of a replica set in the sharded clusterv (specifically, shard replica set and config servers) is equal to the \fBShardingTaskExecutorPoolMinSize\f1\f1\&. .IP When set for a \fBmongod\f1\f1, the instance\(aqs minimum number of connections in the instance\(aqs connection pool to each node of another replica set in the sharded cluster (specifically, shard replica set and config servers) is equal to the \fBShardingTaskExecutorPoolMinSize\f1\f1\&. .RE .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets the \fBShardingTaskExecutorPoolReplicaSetMatching\f1\f1 to \fB"automatic"\f1 during startup: .PP .EX mongod \-\-setParameter ShardingTaskExecutorPoolReplicaSetMatching="automatic" .EE .PP During run time, you can also set the parameter with the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, ShardingTaskExecutorPoolReplicaSetMatching: "automatic" } ) .EE .RE .PP \fBtaskExecutorPoolSize\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP Type: integer .PP Default: 1 .PP The number of Task Executor connection pools to use for a given \fBmongos\f1\f1\&. .PP If the parameter value is \fB0\f1 or less, the number of Task Executor connection pools is the number of cores with the following exceptions: .RS .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. .RE .PP When running MongoDB 6.2 or newer on Linux, you cannot modify the \fBtaskExecutorPoolSize\f1\f1 from the default value of \fB1\f1\&. You may modify this parameter when running MongoDB on Windows or macOS. .PP The default value of \fBtaskExecutorPoolSize\f1\f1 is \fB1\f1: .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX mongos \-\-setParameter taskExecutorPoolSize=6 .EE .RS .IP \(bu 2 \fBShardingTaskExecutorPoolMaxSize\f1\f1 .IP \(bu 2 \fBShardingTaskExecutorPoolMinSize\f1\f1 .RE .RE .PP \fBloadRoutingTableOnStartup\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP Type: boolean .PP \fIDefault\f1: true .PP Configures a \fBmongos\f1\f1 instance to preload the routing table for a sharded cluster on startup. With this setting enabled, the \fBmongos\f1\f1 caches the cluster\-wide routing table for each sharded collection as part of its startup procedure, before it begins accepting client connections. .PP Without this setting enabled, the \fBmongos\f1\f1 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. .PP A \fBmongos\f1\f1 instance with the \fBloadRoutingTableOnStartup\f1\f1 parameter enabled may experience longer startup times, but will result in faster servicing of initial client connections once started. .PP \fBloadRoutingTableOnStartup\f1\f1 is enabled by default. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RE .PP \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartup\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP Type: boolean .PP \fIDefault\f1: true .PP Configures a \fBmongos\f1\f1 instance to prewarm its connection pool on startup. With this parameter enabled, the \fBmongos\f1\f1 attempts to establish \fBShardingTaskExecutorPoolMinSize\f1\f1 network connections to each shard server as part of its startup procedure, before it begins accepting client connections. .PP A timeout for this behavior can be configured with the \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartupWaitMS\f1\f1 parameter. If this timeout is reached, the \fBmongos\f1\f1 will begin accepting client connections regardless of the size of its connection pool. .PP A \fBmongos\f1\f1 instance with this parameter enabled may experience longer startup times, but will result in faster servicing of initial client connections once started. .PP \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartup\f1\f1 is enabled by default. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RS .IP \(bu 2 \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartupWaitMS\f1\f1 .IP \(bu 2 \fBShardingTaskExecutorPoolMinSize\f1\f1 .RE .RE .PP \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartupWaitMS\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP Type: integer .PP \fIDefault\f1: 2000 (2 seconds) .PP Sets the timeout threshold in milliseconds for a \fBmongos\f1\f1 to wait for \fBShardingTaskExecutorPoolMinSize\f1\f1 connections to be established per shard host when using the \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartup\f1\f1 parameter. If this timeout is reached, the \fBmongos\f1\f1 will begin accepting client connections regardless of the size of its connection pool. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .RS .IP \(bu 2 \fBwarmMinConnectionsInShardingTaskExecutorPoolOnStartup\f1\f1 .IP \(bu 2 \fBShardingTaskExecutorPoolMinSize\f1\f1 .RE .RE .PP \fBmigrateCloneInsertionBatchDelayMS\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Type: Non\-negative integer .PP Default: 0 .PP Time in milliseconds to wait between batches of insertions during cloning step of the migration process. This wait is in addition to the \fBsecondaryThrottle\f1\&. .PP The default value of \fB0\f1 indicates no additional wait. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following sets the \fBmigrateCloneInsertionBatchDelayMS\f1\f1 to 200 milliseconds: .PP .EX mongod \-\-setParameter migrateCloneInsertionBatchDelayMS=200 .EE .PP The parameter may also be set using the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, migrateCloneInsertionBatchDelayMS: 200 } ) .EE .RE .PP \fBmigrateCloneInsertionBatchSize\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Type: Non\-negative integer .PP Default: 0 .PP The maximum number of documents to insert in a single batch during the cloning step of the migration process. .PP The default value of \fB0\f1 indicates no maximum number of documents per batch. However, in practice, this results in batches that contain up to 16 MB of documents. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following sets the \fBmigrateCloneInsertionBatchSize\f1\f1 to 100 documents: .PP .EX mongod \-\-setParameter migrateCloneInsertionBatchSize=100 .EE .PP The parameter may also be set using the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, migrateCloneInsertionBatchSize: 100 } ) .EE .RE .PP \fBorphanCleanupDelaySecs\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Default: 900 (15 minutes) .PP Minimum delay before a migrated \fBchunk\f1 is deleted from the source shard. .PP Before deleting the chunk during chunk migration, MongoDB waits for \fBorphanCleanupDelaySecs\f1\f1 or for in\-progress queries involving the chunk to complete on the shard primary, whichever is longer. .PP 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 \fBorphanCleanupDelaySecs\f1\f1\&. .PP 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. .PP 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. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following sets the \fBorphanCleanupDelaySecs\f1\f1 to 20 minutes: .PP .EX mongod \-\-setParameter orphanCleanupDelaySecs=1200 .EE .PP This may also be set using the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, orphanCleanupDelaySecs: 1200 } ) .EE .PP In all versions, the new value of \fBorphanCleanupDelaySecs\f1\f1 is only applied to range deletions created after the value is changed. To apply the new value to existing range deletions, \fBforce a step down\f1\&. .RE .PP \fBpersistedChunkCacheUpdateMaxBatchSize\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Type: Integer .PP Default: 1000 .PP To route and serve operations, shards must know the routing and ownership information associated with their collections. This information propogates from a shard\(aqs primary node to its secondary nodes through the replication of the internal cache collections \fBconfig.cache.collections\f1 and \fBconfig.cache.chunks.\f1\&. .PP In previous versions, updates on the chunk cache collection were performed individually (meaning that an entry was deleted and a new entry was inserted). Starting in MongoDB 7.2, these updates are performed as a batch of deletions followed by a batch of insertions. The updated logic improves performance for collections that contain a large number of chunks. .PP The \fBpersistedChunkCacheUpdateMaxBatchSize\f1 parameter specifies the maximum batch size used for updating the persisted chunk cache. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBpersistedChunkCacheUpdateMaxBatchSize\f1 to 700 at startup: .PP .EX mongod \-\-setParameter persistedChunkCacheUpdateMaxBatchSize=700 .EE .PP You can also set \fBpersistedChunkCacheUpdateMaxBatchSize\f1 during runtime: .PP .EX db.adminCommand( { setParameter: 1, persistedChunkCacheUpdateMaxBatchSize: 700 } ) .EE .RE .PP \fBrangeDeleterBatchDelayMS\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Type: Non\-negative integer .PP Default: 20 .PP The amount of time in milliseconds to wait before the next batch of deletion during the cleanup stage of \fBrange migration\f1 (or the \fBcleanupOrphaned\f1\f1 command). .PP The \fB_secondaryThrottle replication delay\f1 occurs after each batch deletion. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following sets the \fBrangeDeleterBatchDelayMS\f1\f1 to 200 milliseconds: .PP .EX mongod \-\-setParameter rangeDeleterBatchDelayMS=200 .EE .PP The parameter may also be set using the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, rangeDeleterBatchDelayMS: 200 } ) .EE .PP In versions prior to 6.0.3, the new value of \fBrangeDeleterBatchDelayMS\f1\f1 is only applied to range deletions created after the value is changed. To apply the new value to existing range deletions, \fBforce a step down\f1\&. .PP From 6.0.3 on, the new value of the parameter is applied to all the range deletions processed after the update, regardless of when the range deletion was created. .RE .PP \fBrangeDeleterBatchSize\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Type: Non\-negative integer .PP Default: 2147483647 starting in MongoDB 5.1.2 and 5.0.6 .PP The maximum number of documents in each batch to delete during the cleanup stage of \fBrange migration\f1 (or the \fBcleanupOrphaned\f1\f1 command). .PP A value of \fB0\f1 indicates that the system chooses the default value. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBrangeDeleterBatchSize\f1\f1 to 32 documents: .PP .EX mongod \-\-setParameter rangeDeleterBatchSize=32 .EE .PP The parameter may also be set using the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, rangeDeleterBatchSize: 32 } ) .EE .PP In versions prior to 6.0.3, the new value of \fBrangeDeleterBatchSize\f1\f1 is only applied to range deletions created after the value is changed. To apply the new value to existing range deletions, \fBforce a step down\f1\&. .PP From 6.0.3 on, the new value of the parameter is applied to all the range deletions processed after the update, regardless of when the range deletion was created. .RE .PP \fBrangeDeleterHighPriority\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Type: boolean .PP Default: false .PP When \fBtrue\f1, prioritizes cleanup of \fBorphaned documents\f1 over user operations. By default, this is set to \fBfalse\f1 to prioritize user operations over cleanup of orphaned documents. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP The following example sets \fBrangeDeleterHighPriority\f1\f1 to \fBtrue\f1: .PP .EX mongod \-\-setParameter rangeDeleterHighPriority=true .EE .PP The parameter may also be set using the \fBsetParameter\f1\f1 command: .PP .EX db.adminCommand( { setParameter: 1, rangeDeleterBatchSize: true } ) .EE .RE .PP \fBskipShardingConfigurationChecks\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Type: boolean .PP Default: false .PP When \fBtrue\f1, 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\f1\f1 or \fB\-\-shardsvr\f1\f1 options. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX mongod \-\-setParameter skipShardingConfigurationChecks=true .EE .PP Once maintenance has completed, remove the \fBskipShardingConfigurationChecks\f1\f1 parameter when restarting the \fBmongod\f1\f1\&. .RE .PP \fBfindChunksOnConfigTimeoutMS\f1 .RS .PP Available for both \fBmongod\f1\f1 and \fBmongos\f1\f1\&. .PP Type: Non\-negative integer .PP Default: 900000 .PP The timeout in milliseconds for find operations on \fBchunks\f1\f1\&. .PP If there is a large number of chunks in the cluster and chunk loading fails with the error \fBExceededTimeLimit\f1, increase the parameter value: .PP .EX mongod \-\-setParameter findChunksOnConfigTimeoutMS=1000000 .EE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .RE .SS HEALTH MANAGER PARAMETERS .PP \fBactiveFaultDurationSecs\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: Document .PP The amount of time to wait from a \fBHealth Managers Overview\f1 failure until the \fBmongos\f1 is removed from the cluster, in seconds. .PP When a failure is detected and a Health Manager is configured as \fBcritical\f1, the server waits for the specified interval before removing the \fBmongos\f1 from the cluster. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP For example, to set the duration from failure to crash to five minutes, issue the following at startup: .PP .EX mongos \-\-setParameter activeFaultDurationSecs=300 .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongos\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, activeFaultDurationSecs: 300 } ) .EE .PP Parameters set with \fBsetParameter\f1\f1 do not persist across restarts. See the \fBsetParameter page\f1 for details. .PP To make this setting persistent, set \fBactiveFaultDurationSecs\f1 in your \fBmongos config file\f1 using the \fBsetParameter\f1\f1 option as in the following example: .PP .EX setParameter: activeFaultDurationSecs: 300 .EE .RE .PP \fBhealthMonitoringIntensities\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: Array of documents .PP Use this parameter to set intensity levels for Health Managers\&. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP \fBhealthMonitoringIntensities\f1 accepts an array of documents, \fBvalues\f1\&. Each document in \fBvalues\f1 takes two fields: .RS .IP \(bu 2 \fBtype\f1, the Health Manager facet .IP \(bu 2 \fBintensity\f1, the intensity level .RE .SS HEALTH MANAGERS .RS .IP \(bu 2 .RS .IP \(bu 4 Facet .IP \(bu 4 What the Health Observer Checks .RE .IP \(bu 2 .RS .IP \(bu 4 \fBconfigServer\f1 .IP \(bu 4 Cluster health issues related to connectivity to the config server. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBdns\f1 .IP \(bu 4 Cluster health issues related to DNS availability and functionality. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBldap\f1 .IP \(bu 4 Cluster health issues related to LDAP availability and functionality. .RE .RE .SS INTENSITY LEVELS .RS .IP \(bu 2 .RS .IP \(bu 4 Intensity Level .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 \fBcritical\f1 .IP \(bu 4 The Health Manager on this facet is enabled and has the ability to move the failing \fBmongos\f1 out of the cluster if an error occurs. The Health Manager waits the amount of time specified by \fBactiveFaultDurationSecs\f1\f1 before stopping and moving the \fBmongos\f1 out of the cluster automatically. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBnon\-critical\f1 .IP \(bu 4 The Health Manager on this facet is enabled and logs errors, but the \fBmongos\f1 remains in the cluster if errors are encountered. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBoff\f1 .IP \(bu 4 The Health Manager on this facet is disabled. The \fBmongos\f1 does not perform any health checks on this facet. This is the default intensity level. .RE .RE .PP For example, to set the \fBdns\f1 Health Manager facet to the \fBcritical\f1 intensity level, issue the following at startup: .PP .EX mongos \-\-setParameter \(aqhealthMonitoringIntensities={ values:[ { type:"dns", intensity: "critical"} ] }\(aq .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongos\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, healthMonitoringIntensities: { values: [ { type: "dns", intensity: "critical" } ] } } ) } ) .EE .PP Parameters set with \fBsetParameter\f1\f1 do not persist across restarts. See the \fBsetParameter page\f1 for details. .PP To make this setting persistent, set \fBhealthMonitoringIntensities\f1 in your \fBmongos config file\f1 using the \fBsetParameter\f1\f1 option as in the following example: .PP .EX setParameter: healthMonitoringIntensities: "{ values:[ { type:\"dns\", intensity: \"critical\"} ] }" .EE .RE .PP \fBhealthMonitoringIntervals\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: Array of documents .PP How often this Health Manager will run, in milliseconds. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP \fBhealthMonitoringIntervals\f1 accepts an array of documents, \fBvalues\f1\&. Each document in \fBvalues\f1 takes two fields: .RS .IP \(bu 2 \fBtype\f1, the Health Manager facet .IP \(bu 2 \fBinterval\f1, the time interval it runs at, in milliseconds .RE .SS HEALTH MANAGERS .RS .IP \(bu 2 .RS .IP \(bu 4 Facet .IP \(bu 4 What the Health Observer Checks .RE .IP \(bu 2 .RS .IP \(bu 4 \fBconfigServer\f1 .IP \(bu 4 Cluster health issues related to connectivity to the config server. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBdns\f1 .IP \(bu 4 Cluster health issues related to DNS availability and functionality. .RE .IP \(bu 2 .RS .IP \(bu 4 \fBldap\f1 .IP \(bu 4 Cluster health issues related to LDAP availability and functionality. .RE .RE .PP For example, to set the \fBldap\f1 Health Manager facet to the run health checks every 30 seconds, issue the following at startup: .PP .EX mongos \-\-setParameter \(aqhealthMonitoringIntervals={ values:[ { type:"ldap", interval: "30000"} ] }\(aq .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongos\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, healthMonitoringIntervals: { values: [ { type: "ldap", interval: "30000" } ] } } ) } ) .EE .PP Parameters set with \fBsetParameter\f1\f1 do not persist across restarts. See the \fBsetParameter page\f1 for details. .PP To make this setting persistent, set \fBhealthMonitoringIntervals\f1 in your \fBmongos config file\f1 using the \fBsetParameter\f1\f1 option as in the following example: .PP .EX setParameter: healthMonitoringIntervals: "{ values: [{type: \"ldap\", interval: 200}] }" .EE .RE .PP \fBprogressMonitor\f1 .RS .PP Available for \fBmongos\f1\f1 only. .PP \fIType\f1: Document .PP \fBProgress Monitor\f1 runs tests to ensure that Health Manager checks do not become stuck or unresponsive. Progress Monitor runs these tests in intervals specified by \fBinterval\f1\&. If a health check begins but does not complete within the timeout given by \fBdeadline\f1, Progress Monitor stops the \fBmongos\f1 and removes it from the cluster. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .SS PROGRESSMONITOR FIELDS .RS .IP \(bu 2 .RS .IP \(bu 4 Field .IP \(bu 4 Description .IP \(bu 4 Units .RE .IP \(bu 2 .RS .IP \(bu 4 \fBinterval\f1 .IP \(bu 4 How often to ensure Health Managers are not stuck or unresponsive. .IP \(bu 4 Milliseconds .RE .IP \(bu 2 .RS .IP \(bu 4 \fBdeadline\f1 .IP \(bu 4 Timeout before automatically failing the \fBmongos\f1 if a Health Manager check is not making progress. .IP \(bu 4 Seconds .RE .RE .PP To set the \fBinterval\f1 to 1000 milliseconds and the \fBdeadline\f1 to 300 seconds, issue the following at startup: .PP .EX mongos \-\-setParameter \(aqprogressMonitor={"interval": 1000, "deadline": 300}\(aq .EE .PP Or if using the \fBsetParameter\f1\f1 command in a \fBmongosh\f1\f1 session that is connected to a running \fBmongos\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, progressMonitor: { interval: 1000, deadline: 300 } ) } ) .EE .PP Parameters set with \fBsetParameter\f1\f1 do not persist across restarts. See the \fBsetParameter page\f1 for details. .PP To make this setting persistent, set \fBprogressMonitor\f1 in your \fBmongos config file\f1 using the \fBsetParameter\f1\f1 option as in the following example: .PP .EX setParameter: progressMonitor: "{ interval: 1000, deadline: 300 }" .EE .RE .SS STORAGE PARAMETERS .PP \fBhonorSystemUmask\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIDefault\f1: \fBfalse\f1 .PP If \fBhonorSystemUmask\f1\f1 is set to \fBtrue\f1, new files created by MongoDB have permissions in accordance with the user\(aqs \fBumask\f1 settings. You cannot set \fBprocessUmask\f1\f1 if \fBhonorSystemUmask\f1\f1 is set to \fBtrue\f1\&. .PP If \fBhonorSystemUmask\f1\f1 is set to \fBfalse\f1, new files created by MongoDB have permissions set to \fB600\f1, which gives read and write permissions only to the owner. New directories have permissions set to \fB700\f1\&. You can use \fBprocessUmask\f1\f1 to override the default permissions for groups and other users on all new files created by MongoDB. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP .EX mongod \-\-setParameter honorSystemUmask=true .EE .PP \fBhonorSystemUmask\f1\f1 is not available on Windows systems. .RE .PP \fBjournalCommitInterval\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Specify an integer between \fB1\f1 and \fB500\f1 signifying the number of milliseconds (ms) between journal commits. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP Consider the following example which sets the \fBjournalCommitInterval\f1\f1 to \fB200\f1 ms: .PP .EX db.adminCommand( { setParameter: 1, journalCommitInterval: 200 } ) .EE .PP \fBstorage.journal.commitIntervalMs\f1\f1 .RE .PP \fBminSnapshotHistoryWindowInSeconds\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIDefault\f1: \fB300\f1 .PP The minimum time window in seconds for which the storage engine keeps the snapshot history. If you query data using read concern \fB"snapshot"\f1\f1 and specify an \fBatClusterTime\f1 value older than the specified \fBminSnapshotHistoryWindowInSeconds\f1, \fBmongod\f1\f1 returns a \fBSnapshotTooOld\f1 error. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP Specify an integer greater than or equal to (\fB>=\f1) 0. .PP Consider the following example which sets the \fBminSnapshotHistoryWindowInSeconds\f1 to \fB600\f1 seconds: .PP .EX db.adminCommand( { setParameter: 1, minSnapshotHistoryWindowInSeconds: 600 } ) .EE .PP Increasing the value of \fBminSnapshotHistoryWindowInSeconds\f1\f1 increases disk usage. For more information, see \fBSnapshot History Retention\f1\&. .PP To modify this value for a MongoDB Atlas (https://www.mongodb.com/docs/atlas/) cluster, you must contact Atlas Support (https://www.mongodb.com/docs/atlas/support/)\&. .RE .PP \fBprocessUmask\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Overrides the default permissions used for groups and other users when \fBhonorSystemUmask\f1\f1 is set to \fBfalse\f1\&. By default, when \fBhonorSystemUmask\f1\f1 is set to \fBfalse\f1, new files created by MongoDB have permissions set to \fB600\f1\&. Use the \fBprocessUmask\f1 parameter to override this default with a custom \fBumask\f1 value. The file owner inherits permissions from the system \fBumask\f1\&. .PP This parameter is only available at startup. To set the parameter, use the \fBsetParameter\f1\f1 setting. .PP You cannot set this parameter if \fBhonorSystemUmask\f1\f1 is set to \fBtrue\f1\&. .PP Consider the following example, which sets the permissions for groups and other users to read/write only and retains the system \fBumask\f1 settings for the owner: .PP .EX mongod \-\-setParameter processUmask=011 .EE .PP \fBprocessUmask\f1\f1 is not available on Windows systems. .RE .PP \fBstorageEngineConcurrentReadTransactions\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 128 .PP Starting in MongoDB 7.0, this parameter is available for all storage engines. In earlier versions, this parameter is available for the WiredTiger storage engine only. .PP Specify the maximum number of concurrent read transactions (read tickets) allowed into the storage engine. .PP If you use the default value, MongoDB dynamically adjusts the number of tickets to optimize performance, with a highest possible value of 128. .PP Starting in MongoDB 7.0, if you set \fBstorageEngineConcurrentReadTransactions\f1 to a non\-default value, it disables an algorithm that dynamically adjusts the number of concurrent storage engine transactions. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX db.adminCommand( { setParameter: 1, storageEngineConcurrentReadTransactions: } ) .EE .PP The \fBwiredTigerConcurrentReadTransactions\f1 parameter was renamed to \fBstorageEngineConcurrentReadTransactions\f1\&. .PP \fBwiredTiger.concurrentTransactions\f1\f1 .RE .PP \fBstorageEngineConcurrentWriteTransactions\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP Starting in MongoDB 7.0, this parameter is available for all storage engines. In earlier versions, this parameter is available for the WiredTiger storage engine only. .PP Specify the maximum number of concurrent write transactions allowed into the WiredTiger storage engine. .PP By default, MongoDB sets \fBstorageEngineConcurrentWriteTransactions\f1 to whichever value is higher: .RS .IP \(bu 2 Number of cores on the machine running MongoDB .IP \(bu 2 4 .RE .PP If you use the default value, MongoDB dynamically adjusts the number of tickets to optimize performance, with a highest possible value of 128. .PP Starting in MongoDB 7.0, if you set \fBstorageEngineConcurrentWriteTransactions\f1 to a non\-default value, it disables an algorithm that dynamically adjusts the number of concurrent storage engine transactions. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX db.adminCommand( { setParameter: 1, storageEngineConcurrentWriteTransactions: } ) .EE .PP The \fBwiredTigerConcurrentWriteTransactions\f1 parameter was renamed to \fBstorageEngineConcurrentWriteTransactions\f1\&. .PP \fBwiredTiger.concurrentTransactions\f1\f1 .RE .PP \fBsyncdelay\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Specify the interval in seconds when \fBmongod\f1\f1 flushes its working memory to disk. By default, \fBmongod\f1\f1 flushes memory to disk every 60 seconds. In almost every situation you should not set this value and use the default setting. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP Consider the following example which sets the \fBsyncdelay\f1 to \fB60\f1 seconds: .PP .EX db.adminCommand( { setParameter: 1, syncdelay: 60 } ) .EE .PP To provide \fBdurable\f1 data, \fBWiredTiger\f1 uses \fBcheckpoints\f1\&. For more details, see \fBJournaling and the WiredTiger Storage Engine\f1\&. .RS .IP \(bu 2 \fBjournalCommitInterval\f1\f1 .IP \(bu 2 \fBstorage.syncPeriodSecs\f1\f1 .RE .RE .PP \fBtemporarilyUnavailableBackoffBaseMs\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Specifies the initial delay before retying a write operation that was rolled back due to cache pressure. .PP In rare circumstances, a write can fail due to cache pressure. When this happens MongoDB issues a \fBTemporarilyUnavailable\f1 error and increments the \fBtemporarilyUnavailableErrors\f1 counter in two places: the slow query log and the \fBFull Time Diagnostic Data Capture (FTDC)\f1\&. .PP Individual operations within multi\-document transactions never return \fBTemporarilyUnavailable\f1 errors. .PP Adjust the write retry properties by modifying the \fBtemporarilyUnavailableBackoffBaseMs\f1\f1 and \fBtemporarilyUnavailableMaxRetries\f1\f1 parameters. .PP The parameter accepts: .RS .IP \(bu 2 .RS .IP \(bu 4 Value .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 \fBinteger >= 0\f1 .IP \(bu 4 Defaults to 1 second. The initial delay between retries. The value increases with each retry to a maximum of 55 seconds. A larger value increases the chance that the cache pressure will be reduced before the next retry. .IP To configure number of retries, use \fBtemporarilyUnavailableMaxRetries\f1\f1\&. .RE .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP To set a new value, use \fBdb.adminCommand()\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, temporarilyUnavailableBackoffBaseMs: 3 } ) .EE .RE .PP \fBtemporarilyUnavailableMaxRetries\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Specifies the maximum number of retries when a write operation is rolled back due to cache pressure. .PP In rare circumstances, a write can fail due to cache pressure. When this happens MongoDB issues a \fBTemporarilyUnavailable\f1 error and increments the \fBtemporarilyUnavailableErrors\f1 counter in two places: the slow query log and the \fBFull Time Diagnostic Data Capture (FTDC)\f1\&. .PP Individual operations within multi\-document transactions never return \fBTemporarilyUnavailable\f1 errors. .PP Adjust the write retry properties by modifying the \fBtemporarilyUnavailableBackoffBaseMs\f1\f1 and \fBtemporarilyUnavailableMaxRetries\f1\f1 parameters. .PP The parameter accepts: .RS .IP \(bu 2 .RS .IP \(bu 4 Value .IP \(bu 4 Description .RE .IP \(bu 2 .RS .IP \(bu 4 \fBinteger >= 0\f1 .IP \(bu 4 Defaults to 10. The maximum number of retries. .IP There is an increasing delay between retries. To configure the backoff time, use \fBtemporarilyUnavailableBackoffBaseMs\f1\f1\&. .RE .RE .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP To set a new value, use \fBdb.adminCommand()\f1\f1: .PP .EX db.adminCommand( { setParameter: 1, temporarilyUnavailableMaxRetries: 5 } ) .EE .RE .SS WIREDTIGER PARAMETERS .PP \fBwiredTigerConcurrentReadTransactions\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP \fIDefault\f1: 128 .PP Starting in MongoDB 7.0, this parameter is available for all storage engines. In earlier versions, this parameter is available for the WiredTiger storage engine only. .PP Specify the maximum number of concurrent read transactions (read tickets) allowed into the storage engine. .PP If you use the default value, MongoDB dynamically adjusts the number of tickets to optimize performance, with a highest possible value of 128. .PP Starting in MongoDB 7.0, if you set \fBwiredTigerConcurrentReadTransactions\f1 to a non\-default value, it disables an algorithm that dynamically adjusts the number of concurrent storage engine transactions. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX db.adminCommand( { setParameter: 1, wiredTigerConcurrentReadTransactions: } ) .EE .PP \fBwiredTiger.concurrentTransactions\f1\f1 .RE .PP \fBwiredTigerConcurrentWriteTransactions\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP \fIType\f1: integer .PP Starting in MongoDB 7.0, this parameter is available for all storage engines. In earlier versions, this parameter is available for the WiredTiger storage engine only. .PP Specify the maximum number of concurrent write transactions allowed into the WiredTiger storage engine. .PP By default, MongoDB sets \fBwiredTigerConcurrentWriteTransactions\f1 to whichever value is higher: .RS .IP \(bu 2 Number of cores on the machine running MongoDB .IP \(bu 2 4 .RE .PP If you use the default value, MongoDB dynamically adjusts the number of tickets to optimize performance, with a highest possible value of 128. .PP Starting in MongoDB 7.0, if you set \fBwiredTigerConcurrentWriteTransactions\f1 to a non\-default value, it disables an algorithm that dynamically adjusts the number of concurrent storage engine transactions. .PP This parameter is available both at runtime and at startup: .RS .IP \(bu 2 To set the parameter at runtime, use the \fBsetParameter\f1\f1 command .IP \(bu 2 To set the parameter at startup, use the \fBsetParameter\f1\f1 setting .RE .PP .EX db.adminCommand( { setParameter: 1, wiredTigerConcurrentWriteTransactions: } ) .EE .PP \fBwiredTiger.concurrentTransactions\f1\f1 .RE .PP \fBwiredTigerEngineRuntimeConfig\f1 .RS .PP Available for \fBmongod\f1\f1 only. .PP Specify \fBwiredTiger\f1 storage engine configuration options for a running \fBmongod\f1\f1 instance. .PP This parameter is only available at runtime. To set the parameter, use the \fBsetParameter\f1\f1 command. .PP Avoid modifying the \fBwiredTigerEngineRuntimeConfig\f1\f1 unless under the direction from MongoDB engineers as this setting has major implication across both WiredTiger and MongoDB. .PP Consider the following operation prototype: .PP .EX db.adminCommand({ "setParameter": 1, "wiredTigerEngineRuntimeConfig": "