MongoDB 7.0 parameters

Updated at:

This topic describes the parameters for ApsaraDB for MongoDB 7.0.

Replica set

Parameter

Restart required

Default

Value range

Minor version range

Description

Official documentation

setParameter.internalDocumentSourceGroupMaxMemoryBytes

No

104857600

[10485760-10485760000]

Unlimited

Specifies the maximum memory that the $group operator can use. Data that exceeds this limit spills to disk.

Not public

setParameter.timeseriesBucketMaxCount

Yes

1000

[1-10000]

Unlimited

Specifies the maximum number of measurements per bucket in a time-series collection.

Not public

setParameter.timeseriesIdleBucketExpiryMemoryUsageThreshold

No

5

[0-6710886400]

Unlimited

Specifies the memory usage threshold that triggers the expiration of idle buckets in a time-series collection. The default value is 5% of the available system memory.

Not public

setParameter.internalQueryMaxPushBytes

No

104857600

[10485760-1048576000]

Unlimited

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

Not public

setParameter.internalQueryMaxAddToSetBytes

No

104857600

[10485760-1048576000]

Unlimited

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

Not public

setParameter.internalDocumentSourceCursorBatchSizeBytes

No

4194304

[1048576-104857600]

Unlimited

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

Not public

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.

Not public

setParameter.internalQueryCacheMaxEntriesPerCollection

No

5000

[0-5000]

Unlimited

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

Note

This parameter applies only to the classic query engine, not the SBE query engine.

Not public

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 multiple compression algorithms are specified, they are listed in descending order of priority.

net.compression.compressors

operationProfiling.mode

Yes

off

[off|slowOp|all]

Unlimited

Specifies the database profiler level.

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 duration in milliseconds after which an operation is considered a slow operation.

operationProfiling.slowOpThresholdMs

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Specifies whether to enable GID, which is required for two-way synchronization using DTS or mongoShake.

Self-developed parameter.

replication.oplogSizeMB

No

10%

[1024-1073741824]

Unlimited

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

replication.oplogSizeMB

rsconf.writeConcernMajorityJournalDefault

No

true

[true|false]

Unlimited

Specifies whether write operations with a majority write concern must also be committed to the journal.

replSetGetConfig

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the time in milliseconds after which an idle cursor expires and is deleted by MongoDB.

Attempting to access an expired cursor returns a cursor not found error.

cursorTimeoutMillis

setParameter.flowControlTargetLagSeconds

No

10

[1-600]

Unlimited

Specifies the replication lag in seconds that triggers flow control. This mechanism prevents the majority commit point from lagging too far behind.

flowControlTargetLagSeconds

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

Unlimited

Specifies the timeout in milliseconds for a transaction 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 parallel replication. The effective maximum number of threads is twice the number of instance CPU cores.

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Specifies whether to enable aggressive memory decommit 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 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. Transactions that exceed this limit are aborted to reduce pressure on the WiredTiger cache.

transactionLifetimeLimitSeconds

storage.oplogMinRetentionHours

No

0

[0.00-720.00]

Unlimited

Specifies the retention period in hours for oplog entries. The value can be a floating-point number.

storage.oplogMinRetentionHours

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Set the storage compression algorithm for collection data (this setting applies only to new tables). If you want to use different compression algorithms for different tables, you need to use an explicit createCollection command with the relevant options.

storage.wiredTiger.collectionConfig.blockCompressor

setParameter.minSnapshotHistoryWindowInSeconds

No

300

[0-600]

Unlimited

Specifies the duration in seconds for which the WiredTiger storage engine retains snapshot history. A value of 0 disables this feature.

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 the primary to a secondary, which then replicates to a hidden member. Alternatively, a hidden member can replicate from the primary and then pass the data to another secondary.

rsconf.chainingAllowed

setParameter.periodicNoopIntervalSecs

Yes

10

[1-10]

Unlimited

Specifies the interval in seconds for writing noop operations.

periodicNoopIntervalSecs

Sharded cluster (shard)

Parameter

Restart required

Default

Values

Minor engine version

Description

Documentation

setParameter.internalDocumentSourceGroupMaxMemoryBytes

No

104857600

[10485760-10485760000]

Unlimited

Specifies the maximum memory in bytes that the $group operator can use. If this limit is exceeded, the excess data spills to disk.

Not publicly available

setParameter.timeseriesBucketMaxCount

Yes

1000

[1-10000]

Unlimited

Specifies the maximum number of measurements that can be stored in a single bucket of a time series collection.

Not publicly available

setParameter.timeseriesIdleBucketExpiryMemoryUsageThreshold

No

5

[0-6710886400]

Unlimited

Specifies the memory usage threshold for expiring idle buckets in a time series collection. The default value is 5% of the available system memory.

Not publicly available

setParameter.internalQueryMaxPushBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum amount of memory in bytes that the $push operator can use.

Not publicly available

setParameter.internalQueryMaxAddToSetBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum amount of memory in bytes that the $addToSet operator can use.

Not publicly available

setParameter.internalDocumentSourceCursorBatchSizeBytes

No

4194304

[1048576-104857600]

Unlimited

Specifies the maximum data size in bytes that a DocumentSourceCursor can cache from the underlying PlanExecutor before pipeline processing begins.

Not publicly available

setParameter.internalQueryMaxBlockingSortMemoryUsageBytes

No

104857600

[33554432-268435456]

Unlimited

Specifies the maximum amount of memory in bytes that a blocking sort stage can use during a query. The default value is 100 MB.

Not publicly available

setParameter.internalQueryCacheMaxEntriesPerCollection

No

5000

[0-5000]

Unlimited

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

Note

This parameter applies only to the classic query engine, not the Slot-Based Execution (SBE) engine.

Not publicly available

net.compression.compressors

Yes

snappy,zstd,zlib

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

Unlimited

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

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

Specifies the threshold in milliseconds for slow operations. Operations that take longer than this threshold are considered slow operations.

operationProfiling.slowOpThresholdMs

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Specifies whether to enable Global IDs (GIDs) to support bidirectional synchronization for services like Data Transmission Service (DTS) or mongoShake.

self-developed parameter

replication.oplogSizeMB

No

10%

[1024-1073741824]

Unlimited

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

replication.oplogSizeMB

rsconf.writeConcernMajorityJournalDefault

No

true

[true|false]

Unlimited

Determines whether writes with a majority write concern require the journal to be persisted to disk.

replSetGetConfig

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the expiration threshold in milliseconds for idle cursors.

MongoDB automatically closes a cursor that remains idle longer than this threshold. Attempting to use a closed cursor causes a "cursor not found" error.

cursorTimeoutMillis

setParameter.flowControlTargetLagSeconds

No

10

[1-600]

Unlimited

Specifies the threshold in seconds that triggers the flowControl mechanism. This mechanism keeps the majority commit point from falling too far behind.

flowControlTargetLagSeconds

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

Unlimited

Specifies the timeout in milliseconds for acquiring locks within a transaction.

maxTransactionLockRequestTimeoutMillis

setParameter.migrateCloneInsertionBatchSize

No

0

[0-1000]

Unlimited

Specifies the maximum number of documents in a single batch during the cloning stage of a chunk migration. A value of 0 (the default) means the batch size is limited only by the 16 MB BSON document size limit.

migrateCloneInsertionBatchSize

setParameter.oplogFetcherUsesExhaust

Yes

true

[true|false]

Unlimited

Specifies whether to enable streaming replication, which is enabled by default (true).

oplogFetcherUsesExhaust

setParameter.rangeDeleterBatchDelayMS

No

20

[0-600000]

Unlimited

Specifies the delay in milliseconds between batch deletions during the cleanup stage of a chunk migration. This also affects thecleanupOrphaned command, which removes orphaned documents.

rangeDeleterBatchDelayMS

setParameter.rangeDeleterBatchSize

No

0

[0-2147483647]

Unlimited

Specifies the maximum number of documents in a single batch for asynchronous deletions during the cleanup stage of a chunk migration. A value of 0 (the default) uses the kernel-preset batch size (equivalent to 2147483647, meaning no limit on the number of documents deleted per batch).

rangeDeleterBatchSize

setParameter.replWriterThreadCount

Yes

16

[1-256]

Unlimited

Specifies the maximum number of threads for parallel replication. The effective maximum is twice the number of the instance's CPU cores.

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Specifies whether to enable aggressive memory decommitment for tcmalloc, which is disabled by default (0).

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

Unlimited

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

tcmallocReleaseRate

setParameter.transactionLifetimeLimitSeconds

No

60

[1-300]

Unlimited

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

transactionLifetimeLimitSeconds

storage.oplogMinRetentionHours

No

0

[0.00-720.00]

Unlimited

Specifies the minimum retention period in hours for oplog entries. Supports floating-point numbers.

storage.oplogMinRetentionHours

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Sets the default storage compression algorithm for collection data. This change affects only newly created collections. To use a different compression algorithm for a specific collection, use the explicitcreateCollection command with the appropriate options.

storage.wiredTiger.collectionConfig.blockCompressor

setParameter.receiveChunkWaitForRangeDeleterTimeoutMS

No

10000

[10000-3600000]

Unlimited

Specifies the timeout in milliseconds to wait for the deletion of orphaned documents before a chunk migration begins.

Not publicly available

setParameter.minSnapshotHistoryWindowInSeconds

No

300

[0-600]

Unlimited

Specifies the minimum duration in seconds that the WiredTiger engine retains snapshot history. A value of 0 disables history retention.

minSnapshotHistoryWindowInSeconds

rsconf.chainingAllowed

No

true

[true|false]

Unlimited

Specifies whether chained replication is allowed in the shard.

For example, a primary member replicates to a secondary member, which in turn replicates to a hidden member; or a primary member replicates to a hidden member, which then replicates to a secondary member.

rsconf.chainingAllowed

setParameter.periodicNoopIntervalSecs

Yes

10

[1-10]

Unlimited

Specifies the interval in seconds for no-op writes.

periodicNoopIntervalSecs

Sharded cluster (mongos)

Parameter

Restart required

Default

Value

Minor version

Description

Documentation

setParameter.taskExecutorPoolSize

Yes

1

[1-32]

Base version 7.0.26 and later

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

taskExecutorPoolSize

setParameter.readHedgingMode

No

on

[on|off]

N/A

Controls whether to enable Hedged Reads.

readHedgingMode

net.compression.compressors

Yes

snappy,zstd,zlib

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

N/A

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

net.compression.compressors

operationProfiling.slowOpThresholdMs

No

100

[0-65536]

N/A

Specifies the threshold in milliseconds for slow operations. Operations exceeding this threshold are considered slow.

operationProfiling.slowOpThresholdMs

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

N/A

Specifies the expiration threshold in milliseconds for idle cursors. If a cursor remains idle for longer than this threshold, MongoDB automatically closes the cursor. Subsequent attempts to use the closed cursor result in a "cursor not found" error.

cursorTimeoutMillis

setParameter.ShardingTaskExecutorPoolHostTimeoutMS

No

300000

[60000-3600000]

N/A

Specifies the timeout in milliseconds after which a mongos instance drops all connections in the TaskExecutor connection pool for a specific host.

ShardingTaskExecutorPoolHostTimeoutMS

setParameter.ShardingTaskExecutorPoolMaxConnecting

No

2

[1-32]

N/A

Specifies the maximum number of concurrent connections that can be established when initializing the TaskExecutor connection pool for a sharded instance. This parameter controls the rate at which a mongos instance establishes connections to a mongod instance.

ShardingTaskExecutorPoolMaxConnecting

setParameter.ShardingTaskExecutorPoolMaxSize

No

32767

[1-32767]

N/A

Specifies the maximum number of connections in each TaskExecutor connection pool for a sharded instance.

ShardingTaskExecutorPoolMaxSize

setParameter.ShardingTaskExecutorPoolMinSize

No

1

[1-256]

N/A

Specifies the minimum number of connections in each TaskExecutor connection pool for a sharded instance.

ShardingTaskExecutorPoolMinSize

setParameter.ShardingTaskExecutorPoolRefreshRequirementMS

No

60000

[30000-3600000]

N/A

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

ShardingTaskExecutorPoolRefreshRequirementMS

setParameter.ShardingTaskExecutorPoolRefreshTimeoutMS

No

20000

[5000-600000]

N/A

Specifies how long, in milliseconds, a mongos instance waits for a heartbeat response.

ShardingTaskExecutorPoolRefreshTimeoutMS

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

N/A

Controls whether to enable aggressive memory decommit for tcmalloc. A value of 0 (the default) disables this feature.

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

N/A

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

tcmallocReleaseRate

Sharded cluster (ConfigServer)

Parameter

Requires restart

Default

Value

Minor version

Description

Documentation

net.compression.compressors

Yes

snappy,zstd,zlib

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

N/A

Sets the network compression algorithms for mongod or mongos. The algorithms are applied in the order listed.

net.compression.compressors

operationProfiling.mode

Yes

off

[off|slowOp|all]

N/A

Sets the mode 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]

N/A

Sets the threshold in milliseconds that defines a slow operation.

operationProfiling.slowOpThresholdMs

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

N/A

Controls whether to enable GID, which is required for two-way synchronization with services like Data Transmission Service (DTS) or mongoShake.

self-developed parameter

replication.oplogSizeMB

No

10%

[1024-1073741824]

N/A

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

replication.oplogSizeMB

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

N/A

The expiration threshold in milliseconds for an idle cursor. If a cursor remains idle for longer than this threshold, MongoDB automatically closes the cursor. Subsequent attempts to use the closed cursor result in a "cursor not found" error.

cursorTimeoutMillis

setParameter.flowControlTargetLagSeconds

No

10

[1-600]

N/A

The threshold in seconds that triggers the flow control mechanism. Flow control is used to ensure that the majority commit point does not fall too far behind.

flowControlTargetLagSeconds

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

N/A

The time in milliseconds a transaction will wait to acquire a lock before timing out.

maxTransactionLockRequestTimeoutMillis

setParameter.oplogFetcherUsesExhaust

Yes

true

[true|false]

N/A

Enables or disables streaming replication.

oplogFetcherUsesExhaust

setParameter.replWriterThreadCount

Yes

16

[1-256]

N/A

The maximum number of threads for parallel replication in primary-secondary synchronization. The effective maximum number of threads is twice the number of the instance's CPU cores.

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

N/A

Enables or disables aggressive memory decommit for tcmalloc.

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

N/A

The rate at which tcmalloc releases memory to the OS. A higher value means a faster rate.

tcmallocReleaseRate

setParameter.transactionLifetimeLimitSeconds

No

60

[1-300]

N/A

The lifetime of a transaction in seconds. A transaction that runs longer than this limit is aborted to relieve pressure on the WT cache.

transactionLifetimeLimitSeconds

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

N/A

Sets the default storage compression algorithm for newly created collections. This change does not affect existing collections. To use different compression algorithms for different collections, you must explicitly run the createCollection command with related options.

storage.wiredTiger.collectionConfig.blockCompressor