Parameters for MongoDB 4.4

更新时间:
复制 MD 格式

This topic describes all parameters for ApsaraDB for MongoDB 4.4.

Replica set

Parameter

Restart required

Default

Value

Minor version

Description

Documentation

setParameter.internalDocumentSourceGroupMaxMemoryBytes

No

104857600

[10485760-10485760000]

Unlimited

Specifies the maximum memory that the $group operator can use. Operations that exceed this limit spill to disk.

Not publicly documented

setParameter.internalQueryMaxPushBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum memory that the $push operator can use.

Not publicly documented

setParameter.internalQueryMaxAddToSetBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum memory that the $addToSet operator can use.

Not publicly documented

setParameter.internalDocumentSourceCursorBatchSizeBytes

No

4194304

[1048576-104857600]

Unlimited

Specifies the maximum amount of data that a DocumentSourceCursor caches from the underlying PlanExecutor before pipeline processing.

Not publicly documented

setParameter.internalQueryMaxBlockingSortMemoryUsageBytes

No

104857600

[33554432-268435456]

Unlimited

Specifies the maximum memory in bytes that a blocking sort operation can use. The default value is 100 MB.

Not publicly documented

setParameter.internalQueryCacheSize

No

5000

[0-5000]

Unlimited

Specifies the maximum number of entries in the query plan cache for a collection.

Not publicly documented

net.compression.compressors

Yes

snappy,zstd,zlib

[snappy|zlib|zstd|snappy,zstd,zlib|disabled]

Unlimited

Specifies the network compression algorithm for mongod or mongos. If you specify multiple algorithms, they are prioritized in the order listed.

net.compression.compressors

net.serviceExecutor

Yes

synchronous

[synchronous|adaptive]

Unlimited

Determines the threading and execution model for mongod or mongos.

net.serviceExecutor

operationProfiling.mode

Yes

off

[off|slowOp|all]

Unlimited

Specifies the profiling level for the query profiler.

Note

Enabling this parameter can degrade instance performance. Use this parameter with caution in a production environment.

operationProfiling.mode

operationProfiling.slowOpThresholdMs

No

100

[0-65536]

Unlimited

Specifies the threshold in milliseconds for a slow operation. An operation is considered slow if its execution time exceeds this value.

operationProfiling.slowOpThresholdMs

replication.enableMajorityReadConcern

Yes

true

[true|false]

Unlimited

Specifies whether to enable majority read concern.

replication.enableMajorityReadConcern

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Specifies whether to enable global identifiers (GIDs) to support bidirectional synchronization with DTS or mongoShake.

Custom parameter

replication.oplogSizeMB

No

10%

[1024-1073741824]

Unlimited

Specifies the maximum size of the oplog in MB. The default value is 10% of the total disk size.

replication.oplogSizeMB

rsconf.writeConcernMajorityJournalDefault

No

true

[true|false]

Unlimited

Specifies whether writes with majority write concern must be persisted to the journal.

replSetGetConfig

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the idle time in milliseconds before MongoDB automatically closes a cursor.

Using a closed cursor results in a "cursor not found" error.

cursorTimeoutMillis

setParameter.flowControlTargetLagSeconds

No

10

[1-600]

Unlimited

Specifies the threshold in seconds that triggers the flow control mechanism. Flow control is used to ensure the majority commit point does not lag significantly.

flowControlTargetLagSeconds

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

Unlimited

Specifies the maximum time in milliseconds a transaction will wait to acquire a lock.

maxTransactionLockRequestTimeoutMillis

setParameter.oplogFetcherUsesExhaust

Yes

true

[true|false]

Unlimited

Specifies whether to enable streaming replication. This feature is enabled by default.

oplogFetcherUsesExhaust

setParameter.replWriterThreadCount

Yes

16

[1-256]

Unlimited

Specifies the maximum number of threads for applying replicated operations in parallel. The effective maximum number of threads is twice the number of CPU cores for the instance.

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Controls whether to enable aggressive memory decommitment for tcmalloc. This feature is disabled by default.

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

Unlimited

Sets the rate at which tcmalloc releases memory to the OS. A higher value results in a faster release rate.

tcmallocReleaseRate

setParameter.transactionLifetimeLimitSeconds

No

60

[1-300]

Unlimited

Specifies the total lifetime of a transaction in seconds. Transactions that run longer than this limit are aborted to reduce pressure on the WiredTiger engine cache.

transactionLifetimeLimitSeconds

storage.oplogMinRetentionHours

No

0

[0.00-720.00]

Unlimited

Specifies the minimum retention period for the oplog in hours. This parameter accepts floating-point values.

storage.oplogMinRetentionHours

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Specifies the default compression algorithm for collections. This setting affects only newly created collections. To use a different compression algorithm for a specific collection, use the createCollection command with the appropriate storage engine options.

storage.wiredTiger.collectionConfig.blockCompressor

setParameter.maxTargetSnapshotHistoryWindowInSeconds

No

300

[0-600]

Unlimited

Specifies the window size in seconds for which the WiredTiger engine retains snapshot history. A value of 0 disables the snapshot history window.

minSnapshotHistoryWindowInSeconds

rsconf.chainingAllowed

No

true

[true|false]

Unlimited

Specifies whether to allow chained replication in the replica set.

For example, data can be replicated from a Primary to a Secondary, and then from that Secondary to a Hidden member. Alternatively, data can be replicated from a Primary to a Hidden member, which then replicates to a Secondary.

rsconf.chainingAllowed

setParameter.periodicNoopIntervalSecs

Yes

10

[1-10]

Unlimited

Specifies the interval in seconds for writing noop entries to the oplog.

periodicNoopIntervalSecs

Sharded cluster

Parameter

Requires restart

Default

Value range

Minor version range

Description

Documentation

setParameter.internalDocumentSourceGroupMaxMemoryBytes

No

104857600

[10485760-10485760000]

Unlimited

Specifies the maximum memory that the $group operator can use. Operations that exceed this limit spill to disk.

Unpublished

setParameter.internalQueryMaxPushBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum memory that the $push operator can use.

Unpublished

setParameter.internalQueryMaxAddToSetBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum memory that the $addToSet operator can use.

Unpublished

setParameter.internalDocumentSourceCursorBatchSizeBytes

No

4194304

[1048576-104857600]

Unlimited

Specifies the maximum amount of data that a DocumentSourceCursor caches from the underlying PlanExecutor before pipeline processing.

Unpublished

setParameter.internalQueryMaxBlockingSortMemoryUsageBytes

No

104857600

[33554432-268435456]

Unlimited

Specifies the maximum amount of memory in bytes that a blocking sort operation can use. The default value is equivalent to 100 MB.

Unpublished

setParameter.internalQueryCacheSize

No

5000

[0-5000]

Unlimited

Specifies the maximum number of entries in the query plan cache for a collection.

Unpublished

net.compression.compressors

Yes

snappy,zstd,zlib

[snappy|zlib|zstd|snappy,zstd,zlib|disabled]

Unlimited

Specifies the network compression algorithm for a mongod or mongos instance. If you specify multiple algorithms, the system prioritizes them in the order listed.

net.compression.compressors

net.serviceExecutor

Yes

synchronous

[synchronous|adaptive]

Unlimited

Determines the threading and execution model that a mongod or mongos instance uses.

net.serviceExecutor

operationProfiling.mode

Yes

off

[off|slowOp|all]

Unlimited

Specifies the level for the query profiler.

Note

Enabling this parameter can degrade instance performance. Use this parameter with caution in a production environment.

operationProfiling.mode

operationProfiling.slowOpThresholdMs

No

100

[0-65536]

Unlimited

Sets the threshold in milliseconds for slow operations. The query profiler considers an operation slow if its duration exceeds this value.

operationProfiling.slowOpThresholdMs

replication.enableMajorityReadConcern

Yes

true

[true|false]

Unlimited

Enables or disables support for majority read concern.

replication.enableMajorityReadConcern

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Enables or disables global identifiers (GIDs) to support bidirectional synchronization with DTS or mongoShake.

Proprietary parameter

replication.oplogSizeMB

No

10%

[1024-1073741824]

Unlimited

Specifies the maximum size of the oplog in MB. The default value is 10% of the total disk size.

replication.oplogSizeMB

rsconf.writeConcernMajorityJournalDefault

No

true

[true|false]

Unlimited

Determines whether a "majority" write concern requires writes to be persisted to the journal.

replSetGetConfig

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the idle time in milliseconds before MongoDB closes a cursor. Using a closed cursor results in a "cursor not found" error.

If a cursor's idle time exceeds the threshold, MongoDB will close the cursor, and any subsequent attempt to access it will return a "cursor not found" error.

cursorTimeoutMillis

setParameter.flowControlTargetLagSeconds

No

10

[1-600]

Unlimited

Specifies the threshold in seconds that triggers the flow control mechanism. This mechanism ensures the majority commit point does not lag significantly.

flowControlTargetLagSeconds

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

Unlimited

Specifies the maximum time in milliseconds a transaction waits to acquire a lock.

maxTransactionLockRequestTimeoutMillis

setParameter.migrateCloneInsertionBatchSize

No

0

[0-1000]

Unlimited

Specifies the maximum number of documents in a single batch during the cloning phase of a chunk migration. A value of 0 indicates that the batch size is limited only by the 16 MB BSON document size limit.

migrateCloneInsertionBatchSize

setParameter.oplogFetcherUsesExhaust

Yes

true

[true|false]

Unlimited

Enables or disables streaming replication.

oplogFetcherUsesExhaust

setParameter.rangeDeleterBatchDelayMS

No

20

[0-600000]

Unlimited

Specifies the delay in milliseconds between deletion batches during the cleanup phase of a chunk migration. This parameter also affects the cleanupOrphaned command, which removes orphaned documents.

rangeDeleterBatchDelayMS

setParameter.rangeDeleterBatchSize

No

0

[0-1000]

Unlimited

Specifies the maximum number of documents per batch for asynchronous deletion during a chunk migration's cleanup phase. A value of 0 directs the system to automatically select a reasonable batch size, which is typically 128.

rangeDeleterBatchSize

setParameter.replWriterThreadCount

Yes

16

[1-256]

Unlimited

Specifies the maximum number of threads for applying replicated operations in parallel. The effective maximum number of threads is twice the number of CPU cores on the instance.

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Controls whether to enable aggressive memory decommitment for tcmalloc.

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

Unlimited

Sets the rate at which tcmalloc releases memory to the operating system. A higher value results in a faster release rate.

tcmallocReleaseRate

setParameter.transactionLifetimeLimitSeconds

No

60

[1-300]

Unlimited

Specifies the maximum lifetime of a transaction in seconds. The system aborts transactions that exceed this limit to reduce pressure on the WiredTiger cache.

transactionLifetimeLimitSeconds

storage.oplogMinRetentionHours

No

0

[0.00-720.00]

Unlimited

Specifies the minimum retention period for the oplog in hours. This parameter accepts floating-point values.

storage.oplogMinRetentionHours

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Specifies the default compression algorithm for new collections. To use a different compression algorithm for a specific collection, run the createCollection command with the appropriate storage engine options.

storage.wiredTiger.collectionConfig.blockCompressor

setParameter.receiveChunkWaitForRangeDeleterTimeoutMS

No

10000

[10000-3600000]

Unlimited

Specifies the timeout, in milliseconds, for deleting orphaned documents before a chunk migration begins.

Unpublished

setParameter.maxTargetSnapshotHistoryWindowInSeconds

No

300

[0-600]

Unlimited

Specifies the duration, in seconds, that the WiredTiger engine retains snapshot history. A value of 0 disables this feature.

minSnapshotHistoryWindowInSeconds

rsconf.chainingAllowed

No

true

[true|false]

Unlimited

Allows or disallows chained replication within the shard.

With chained replication, data can replicate from a primary node to a secondary node and then to a hidden node, or from a primary node to a hidden node and then to a secondary node.

rsconf.chainingAllowed

setParameter.periodicNoopIntervalSecs

Yes

10

[1-10]

Unlimited

Specifies the interval in seconds for writing noop entries to the oplog.

periodicNoopIntervalSecs

Sharded cluster (mongos)

Parameter

Restart required

Default

Value

Minor version range

Description

Official documentation

setParameter.readHedgingMode

No

on

[on|off]

Unlimited

Specifies whether to enable Hedged Reads support.

readHedgingMode

net.compression.compressors

Yes

snappy,zstd,zlib

[snappy|zlib|zstd|snappy,zstd,zlib|disabled]

Unlimited

Specifies the network compression algorithm for mongod or mongos. If you specify multiple algorithms, they are prioritized in the order they are listed.

net.compression.compressors

net.serviceExecutor

Yes

synchronous

[synchronous|adaptive]

Unlimited

Sets the threading and execution model for mongod or mongos.

net.serviceExecutor

operationProfiling.slowOpThresholdMs

No

100

[0-65536]

Unlimited

The threshold in milliseconds for slow operations. Operations whose duration exceeds this value are considered slow.

operationProfiling.slowOpThresholdMs

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the idle time in milliseconds before the server automatically closes a cursor. Attempting to use a closed cursor returns a "cursor not found" error.

cursorTimeoutMillis

setParameter.ShardingTaskExecutorPoolHostTimeoutMS

No

300000

[60000-3600000]

Unlimited

Specifies the time in milliseconds before mongos closes all connections in a host's TaskExecutor connection pool.

ShardingTaskExecutorPoolHostTimeoutMS

setParameter.ShardingTaskExecutorPoolMaxConnecting

No

2

[1-32]

Unlimited

Specifies the maximum number of concurrent connections that the TaskExecutor connection pool can establish. This parameter controls the rate at which mongos establishes connections to mongod.

ShardingTaskExecutorPoolMaxConnecting

setParameter.ShardingTaskExecutorPoolMaxSize

No

32767

[1-32767]

Unlimited

Specifies the maximum number of connections in each TaskExecutor connection pool.

ShardingTaskExecutorPoolMaxSize

setParameter.ShardingTaskExecutorPoolMinSize

No

1

[1-256]

Unlimited

Specifies the minimum number of connections in each TaskExecutor connection pool.

ShardingTaskExecutorPoolMinSize

setParameter.ShardingTaskExecutorPoolRefreshRequirementMS

No

60000

[30000-3600000]

Unlimited

Specifies the interval in milliseconds at which mongos sends heartbeats to idle connections in the TaskExecutor connection pool.

ShardingTaskExecutorPoolRefreshRequirementMS

setParameter.ShardingTaskExecutorPoolRefreshTimeoutMS

No

20000

[5000-600000]

Unlimited

Specifies the duration, in milliseconds, that mongos waits for a heartbeat response.

ShardingTaskExecutorPoolRefreshTimeoutMS

setParameter.taskExecutorPoolSize

Yes

1

[1-32]

Unlimited

Specifies the number of TaskExecutor connection pools on a mongos instance.

taskExecutorPoolSize

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Controls whether to enable aggressive memory decommitment for tcmalloc. A value of 0 disables this feature.

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

Unlimited

Sets the rate at which tcmalloc releases memory to the operating system. A higher value means a faster release rate.

tcmallocReleaseRate

Sharded cluster (ConfigServer)

Parameter

Restart required

Default

Value

Minor version

Description

Official documentation

net.compression.compressors

Yes

snappy,zstd,zlib

[snappy|zlib|zstd|snappy,zstd,zlib|disabled]

Unlimited

Specifies the network compression algorithm for mongod or mongos. If you specify multiple algorithms, they are prioritized in the order listed.

net.compression.compressors

operationProfiling.mode

Yes

off

[off|slowOp|all]

Unlimited

Specifies the level for the query profiler.

Note

Enabling this parameter can degrade instance performance. Use this parameter with caution in a production environment.

operationProfiling.mode

operationProfiling.slowOpThresholdMs

No

100

[0-65536]

Unlimited

Sets the threshold in milliseconds for what is considered a slow operation. Operations that take longer than this value are considered slow.

operationProfiling.slowOpThresholdMs

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Specifies whether to enable global identifiers (GIDs) to support two-way synchronization with DTS or mongoShake.

Self-developed parameter

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the idle time in milliseconds before MongoDB closes an inactive cursor. Subsequent attempts to use the closed cursor will result in a "cursor not found" error.

cursorTimeoutMillis

setParameter.oplogFetcherUsesExhaust

Yes

true

[true|false]

Unlimited

Specifies whether to enable streaming replication. The default value is true.

oplogFetcherUsesExhaust

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Specifies the default compression algorithm for collections. This setting only affects newly created collections. To use a different compression algorithm for a specific collection, use the createCollection command with the appropriate storage engine options.

storage.wiredTiger.collectionConfig.blockCompressor