MongoDB 4.2 parameters

更新时间:
复制 MD 格式

This topic describes the available parameters for ApsaraDB for MongoDB 4.2 as of its last update.

Replica set

Parameter

Restart required

Default

Value

Version range

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, any excess data spills to disk.

Not public

setParameter.internalQueryMaxPushBytes

No

104857600

[10485760-1048576000]

Unlimited

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

Not public

setParameter.internalQueryMaxAddToSetBytes

No

104857600

[10485760-1048576000]

Unlimited

Specifies the maximum memory, in bytes, 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.internalQueryCacheSize

No

5000

[0-5000]

Unlimited

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

Not public

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 instance prioritizes them in the order listed.

net.compression.compressors

net.serviceExecutor

Yes

synchronous

[synchronous|adaptive]

Unlimited

Determines the thread 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

Specifies the execution time threshold, in milliseconds, that defines a slow operation.

operationProfiling.slowOpThresholdMs

replication.enableMajorityReadConcern

Yes

true

[true|false]

Unlimited

Specifies whether to enable support for majority read concern.

replication.enableMajorityReadConcern

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

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

Custom 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

Specifies whether to acknowledge writes with a majority write concern only after committing them to the journal.

replSetGetConfig

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the expiration threshold, in milliseconds, for an idle cursor.

If a cursor remains idle for longer than this threshold, MongoDB removes the cursor. Subsequent attempts to access the cursor result in a "cursor not found" error.

cursorTimeoutMillis

setParameter.flowControlTargetLagSeconds

No

10

[1-600]

Unlimited

Specifies the lag time in seconds that triggers flow control, which keeps the majority commit point from falling too far behind.

flowControlTargetLagSeconds

setParameter.internalQueryExecMaxBlockingSortBytes

No

33554432

[33554432-268435456]

Unlimited

Specifies the maximum amount of memory, in bytes, that a sorting operation can use. The default value is 32 MB.

Not public

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

Unlimited

Specifies the lock acquisition timeout, in milliseconds, for a transaction.

maxTransactionLockRequestTimeoutMillis

setParameter.replWriterThreadCount

Yes

16

[1-256]

Unlimited

Specifies the maximum number of threads for parallel replication. The effective maximum is double the instance's CPU core count.

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Specifies whether to enable aggressive memory release 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 OS. A higher value indicates a faster release rate.

tcmallocReleaseRate

setParameter.transactionLifetimeLimitSeconds

No

60

[1-300]

Unlimited

Specifies the total timeout for a transaction, which defines its lifecycle, in seconds. The system aborts transactions that exceed this limit to reduce pressure on the WiredTiger cache.

transactionLifetimeLimitSeconds

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Sets the storage compression algorithm for collection data. This change applies only to all newly created tables. To use different compression algorithms for different tables, use the explicit createCollection command with the relevant options.

storage.wiredTiger.collectionConfig.blockCompressor

rsconf.chainingAllowed

No

true

[true|false]

Unlimited

Specifies whether to allow chained replication in the replica set.

For example: Replication can occur from a primary to a secondary, and then from that secondary to a hidden member; or from a primary to a hidden member, and then to a secondary.

rsconf.chainingAllowed

setParameter.periodicNoopIntervalSecs

Yes

10

[1-10]

Unlimited

Specifies the interval, in seconds, for writing a noop entry.

periodicNoopIntervalSecs

Sharded cluster

Parameter

Restart required

Default

Value

Minor version range

Description

Official documentation

setParameter.internalDocumentSourceGroupMaxMemoryBytes

No

104857600

[10485760-10485760000]

Unlimited

Limits the maximum amount of memory that the $group operator can use. Data that exceeds this limit spills to temporary files on disk.

Undocumented

setParameter.internalQueryMaxPushBytes

No

104857600

[10485760-1048576000]

Unlimited

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

Undocumented

setParameter.internalQueryMaxAddToSetBytes

No

104857600

[10485760-1048576000]

Unlimited

Limits the maximum amount of memory that the $addToSet operator can use.

Undocumented

setParameter.internalDocumentSourceCursorBatchSizeBytes

No

4194304

[1048576-104857600]

Unlimited

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

Undocumented

setParameter.internalQueryCacheSize

No

5000

[0-5000]

Unlimited

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

Undocumented

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 descending order.

net.compression.compressors

net.serviceExecutor

Yes

synchronous

[synchronous|adaptive]

Unlimited

Determines the thread and execution model used by mongod or mongos.

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

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

operationProfiling.slowOpThresholdMs

replication.enableMajorityReadConcern

Yes

true

[true|false]

Unlimited

Determines whether to enable support for majority read concern.

replication.enableMajorityReadConcern

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Determines whether to enable GID to support two-way synchronization for DTS or mongoShake.

Proprietary 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 are acknowledged only after being committed to the journal.

replSetGetConfig

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the expiration threshold in milliseconds for an idle cursor.

If a cursor remains idle for longer than this threshold, MongoDB removes the cursor. Subsequent attempts to access the cursor result 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. This mechanism ensures that the majority commit point does not lag significantly.

flowControlTargetLagSeconds

setParameter.internalQueryExecMaxBlockingSortBytes

No

33554432

[33554432-268435456]

Unlimited

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

Undocumented

setParameter.maxTransactionLockRequestTimeoutMillis

No

5

[0-60]

Unlimited

Specifies the lock acquisition timeout in milliseconds for a transaction.

maxTransactionLockRequestTimeoutMillis

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 vCPUs of the instance.

replWriterThreadCount

setParameter.tcmallocAggressiveMemoryDecommit

No

0

[0|1]

Unlimited

Determines whether to enable TCMalloc aggressive memory decommitment. A value of 0 disables this feature.

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

Unlimited

Specifies the rate at which TCMalloc releases memory to the operating system. A higher value indicates a faster release rate.

tcmallocReleaseRate

setParameter.transactionLifetimeLimitSeconds

No

60

[1-300]

Unlimited

Specifies the lifetime of a transaction in seconds. A transaction that exceeds this lifetime is aborted to reduce pressure on the WiredTiger cache.

transactionLifetimeLimitSeconds

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Specifies 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, use the createCollection command with the appropriate options.

storage.wiredTiger.collectionConfig.blockCompressor

setParameter.migrateCloneInsertionBatchSize

No

0

[0-1000]

Unlimited

Specifies the maximum number of documents in a single batch during the clone phase of a chunk migration. If set to 0, the batch size is limited only by the 16 MB BSON document size.

migrateCloneInsertionBatchSize

setParameter.rangeDeleterBatchDelayMS

No

20

[0-600000]

Unlimited

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

rangeDeleterBatchDelayMS

setParameter.rangeDeleterBatchSize

No

0

[0-1000]

Unlimited

Specifies the maximum number of documents in a single batch for asynchronous deletion during the cleanup phase of a chunk migration. A value of 0 lets the system automatically choose a reasonable batch size, typically 128.

rangeDeleterBatchSize

rsconf.chainingAllowed

No

true

[true|false]

Unlimited

Determines whether to allow chained replication in a shard.

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

rsconf.chainingAllowed

setParameter.periodicNoopIntervalSecs

Yes

10

[1-10]

Unlimited

Specifies the interval in seconds for writing a no-op entry to the oplog.

periodicNoopIntervalSecs

Sharded cluster (mongos)

Parameter

Restart required

Default

Value

Minor engine version

Description

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 descending order.

net.compression.compressors

net.serviceExecutor

Yes

synchronous

[synchronous|adaptive]

Unlimited

Specifies the thread and execution model used by mongod or mongos.

net.serviceExecutor

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 threshold.

operationProfiling.slowOpThresholdMs

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the expiration threshold in milliseconds for an idle cursor. If a cursor remains idle for longer than this threshold, MongoDB removes the cursor. Subsequent attempts to access the cursor result in a "cursor not found" error.

cursorTimeoutMillis

setParameter.ShardingTaskExecutorPoolHostTimeoutMS

No

300000

[60000-3600000]

Unlimited

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

ShardingTaskExecutorPoolHostTimeoutMS

setParameter.ShardingTaskExecutorPoolMaxConnecting

No

2

[1-32]

Unlimited

Specifies the maximum concurrency for connection initialization in the TaskExecutor connection pool of a sharded instance. This parameter controls the rate at which connections are established from mongos to mongod.

ShardingTaskExecutorPoolMaxConnecting

setParameter.ShardingTaskExecutorPoolMaxSize

No

32767

[1-32767]

Unlimited

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

ShardingTaskExecutorPoolMaxSize

setParameter.ShardingTaskExecutorPoolMinSize

No

1

[1-256]

Unlimited

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

ShardingTaskExecutorPoolMinSize

setParameter.ShardingTaskExecutorPoolRefreshRequirementMS

No

60000

[30000-3600000]

Unlimited

Specifies the interval at which a mongos instance performs heartbeat detection on idle connections in the TaskExecutor connection pool.

ShardingTaskExecutorPoolRefreshRequirementMS

setParameter.ShardingTaskExecutorPoolRefreshTimeoutMS

No

20000

[5000-600000]

Unlimited

Specifies the timeout in milliseconds 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 release for tcmalloc. The default value is 0, which disables this feature.

tcmallocAggressiveMemoryDecommit

setParameter.tcmallocReleaseRate

No

1

[1-10]

Unlimited

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

tcmallocReleaseRate

Sharded cluster (ConfigServer)

Parameter

Restart required

Default

Value

Minor version

Description

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 they are listed.

net.compression.compressors

operationProfiling.mode

Yes

off

[off|slowOp|all]

Unlimited

Specifies the query 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 threshold in milliseconds for a slow operation. An operation is considered slow if its execution time exceeds this threshold.

operationProfiling.slowOpThresholdMs

replication.oplogGlobalIdEnabled

Yes

false

[true|false]

Unlimited

Controls whether GID is enabled to support two-way synchronization for Data Transmission Service (DTS) or mongoShake.

self-developed parameter

setParameter.cursorTimeoutMillis

No

600000

[1-2147483647]

Unlimited

Specifies the expiration threshold in milliseconds for an idle cursor. If a cursor remains idle for longer than this threshold, MongoDB removes the cursor. Subsequent attempts to access the cursor result in a "cursor not found" error.

cursorTimeoutMillis

storage.wiredTiger.collectionConfig.blockCompressor

Yes

snappy

[snappy|zlib|zstd|none]

Unlimited

Specifies 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, use the createCollection command with the appropriate options.

storage.wiredTiger.collectionConfig.blockCompressor