MongoDB 5.0 parameters

更新时间:
复制 MD 格式

This topic describes the parameters for ApsaraDB for MongoDB 5.0.

Replica set

Parameter

Restart required

Default

Value

Version

Description

Documentation

setParameter.internalDocumentSourceGroupMaxMemoryBytes

No

104857600

[10485760-10485760000]

Unlimited

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

Not publicly documented

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 documented

setParameter.internalQueryMaxPushBytes

No

104857600

[10485760-1048576000]

Unlimited

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

Not publicly documented

setParameter.internalQueryMaxAddToSetBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum amount of 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 stage can use. The default value is 100 MiB.

Not publicly documented

setParameter.internalQueryCacheMaxEntriesPerCollection

No

5000

[0-5000]

Unlimited

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

Note

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

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 used by mongod or mongos.

net.serviceExecutor

operationProfiling.mode

Yes

off

[off|slowOp|all]

Unlimited

Specifies the level for the database 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

Defines the threshold in milliseconds, above which an operation is considered a slow operation.

operationProfiling.slowOpThresholdMs

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Specifies whether to enable Global IDs (GIDs) to support two-way synchronization with services like Data Transmission Service (DTS) or mongoShake.

Proprietary parameter

replication.oplogSizeMB

No

10%

[1024-1073741824]

Unlimited

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

replication.oplogSizeMB

rsconf.writeConcernMajorityJournalDefault

No

true

[true|false]

Unlimited

Determines whether writes with majority write concern are acknowledged only after being committed to the on-disk journal.

replSetGetConfig

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

The timeout threshold in milliseconds for idle cursors.

If a cursor is idle for longer than this threshold, MongoDB closes it. Subsequent attempts to use the closed cursor result in a "cursor not found" error.

cursorTimeoutMillis

setParameter.flowControlTargetLagSeconds

No

10

[1-600]

Unlimited

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

flowControlTargetLagSeconds

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

Unlimited

The lock wait timeout for transactions, in milliseconds.

maxTransactionLockRequestTimeoutMillis

setParameter.oplogFetcherUsesExhaust

Yes

true

[true|false]

Unlimited

Specifies whether to use streaming replication. A value of true enables it.

oplogFetcherUsesExhaust

setParameter.replWriterThreadCount

Yes

16

[1-256]

Unlimited

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

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Specifies 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 returns memory to the operating system. A higher value corresponds to a faster release rate.

tcmallocReleaseRate

setParameter.transactionLifetimeLimitSeconds

No

60

[1-300]

Unlimited

The total lifetime of a transaction in seconds. Transactions that exceed this limit are automatically aborted to relieve pressure on the WiredTiger cache.

transactionLifetimeLimitSeconds

storage.oplogMinRetentionHours

No

0

[0.00-720.00]

Unlimited

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

storage.oplogMinRetentionHours

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Sets the storage compression algorithm for collection data. This change takes effect only for all new collections. To use different compression algorithms for different collections, you must use the explicit createCollection command with the relevant options.

storage.wiredTiger.collectionConfig.blockCompressor

setParameter.minSnapshotHistoryWindowInSeconds

No

300

[0-600]

Unlimited

Specifies the duration in seconds that 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 a replica set.

For example, a secondary member can replicate data from the primary member and, in turn, serve as the replication source for another secondary member.

rsconf.chainingAllowed

setParameter.periodicNoopIntervalSecs

Yes

10

[1-10]

Unlimited

The interval in seconds at which a noop operation is performed.

periodicNoopIntervalSecs

Sharded cluster

Parameter

Restart required

Default

Value

Minor version range

Description

Documentation

setParameter.internalDocumentSourceGroupMaxMemoryBytes

No

104857600

[10485760-10485760000]

Unlimited

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

Not publicly documented

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 documented

setParameter.internalQueryMaxPushBytes

No

104857600

[10485760-1048576000]

Unlimited

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

Not publicly documented

setParameter.internalQueryMaxAddToSetBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum amount of 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 amount of memory, in bytes, that a blocking sort stage can use during a query. The default value is 100 MiB.

Not publicly documented

setParameter.internalQueryCacheMaxEntriesPerCollection

No

5000

[0-5000]

Unlimited

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

Note

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

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 used by mongod or mongos.

net.serviceExecutor

operationProfiling.mode

Yes

off

[off|slowOp|all]

Unlimited

Specifies the level for the database 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

The time in milliseconds after which an operation is considered slow.

operationProfiling.slowOpThresholdMs

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Specifies whether to enable Global IDs (GIDs), which support bidirectional synchronization with services like DTS and mongoShake.

Proprietary parameter

replication.oplogSizeMB

No

10%

[1024-1073741824]

Unlimited

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

replication.oplogSizeMB

rsconf.writeConcernMajorityJournalDefault

No

true

[true|false]

Unlimited

Determines whether writes with a majority write concern must be committed to the on-disk journal before being acknowledged.

replSetGetConfig

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

The idle timeout in milliseconds for cursors.

MongoDB closes a cursor that is idle for longer than this period, and subsequent attempts to use it fail with a "cursor not found" error.

cursorTimeoutMillis

setParameter.flowControlTargetLagSeconds

No

10

[1-600]

Unlimited

The replication lag, in seconds, that triggers flow control. This mechanism ensures the majority commit point does not fall too far behind.

flowControlTargetLagSeconds

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

Unlimited

The maximum time in milliseconds a transaction waits for necessary locks.

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 means the batch size is limited only by the 16 MB document size limit.

migrateCloneInsertionBatchSize

setParameter.oplogFetcherUsesExhaust

Yes

true

[true|false]

Unlimited

Specifies whether to enable streaming replication.

oplogFetcherUsesExhaust

setParameter.rangeDeleterBatchDelayMS

No

20

[0-600000]

Unlimited

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

rangeDeleterBatchDelayMS

setParameter.rangeDeleterBatchSize

No

0

[0-1000]

Unlimited

The maximum number of documents in a single batch for asynchronous deletion during the cleanup phase of a chunk migration. A value of 0 allows the system to automatically select a reasonable batch size, which is typically 128.

rangeDeleterBatchSize

setParameter.replWriterThreadCount

Yes

16

[1-256]

Unlimited

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

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Specifies whether to enable aggressive memory decommitment for tcmalloc.

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

Unlimited

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

tcmallocReleaseRate

setParameter.transactionLifetimeLimitSeconds

No

60

[1-300]

Unlimited

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

transactionLifetimeLimitSeconds

storage.oplogMinRetentionHours

No

0

[0.00-720.00]

Unlimited

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

storage.oplogMinRetentionHours

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Sets the default storage compression algorithm for collections. This setting applies only to newly created collections. To use a different compression algorithm for a specific collection, you must specify it when you run the createCollection command.

storage.wiredTiger.collectionConfig.blockCompressor

setParameter.receiveChunkWaitForRangeDeleterTimeoutMS

No

10000

[10000-3600000]

Unlimited

The time in milliseconds to wait for orphaned documents to be deleted before a chunk migration begins.

Not publicly documented

setParameter.minSnapshotHistoryWindowInSeconds

No

300

[0-600]

Unlimited

Specifies the window 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 within a shard.

For example, data can be replicated from the primary to a secondary member, and then from that secondary to a hidden member; or from the primary to a hidden member, and then to a secondary member.

rsconf.chainingAllowed

setParameter.periodicNoopIntervalSecs

Yes

10

[1-10]

Unlimited

The interval, in seconds, at which a no-op write is performed.

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