Updated on 2024-04-01 GMT+08:00

Parameters

Database parameters are key configuration items in a database system. Improper parameter settings may adversely affect database performance. This document describes some important parameters. For details on parameter descriptions, visit MongoDB official website.

For details about how to change parameter values on the console, see Modifying DDS DB Instance Parameters.

  • enableMajorityReadConcern

    This parameter indicates whether data read has been acknowledged by a majority of nodes.

    The default value is false, indicating that data read is returned after being acknowledged by a single node.

    If this parameter is set to true, data read is returned after being acknowledged by a majority of nodes. This operation will increase the size of the LAS file, resulting in high CPU usage and disk usage.

    In DDS, read concern cannot be set to majority. If majority read concern is required, you can set write concern to majority, indicating that data is written to a majority of nodes. In this way, data on most nodes is consistent. Then, by reading data from a single node, it can be ensured that the data has been written to a majority of nodes, and there are no dirty reads.

    Write concern and read concern respectively specify the write and read policies for MongoDB.

    If read concern is set to majority, data read by users has been written to a majority of nodes and will not be rolled back to avoid dirty reads.

  • failIndexKeyTooLong

    The default value is true.

    This parameter cannot be modified to avoid an excessively long index key.

  • net.maxIncomingConnections

    This parameter indicates the maximum number of concurrent connections that dds mongos or mongod can accept. The default value depends on the instance specifications. This parameter is displayed as default before being set, indicating that the parameter value varies with the memory specifications.

  • security.javascriptEnabled

    The default value is false.

    This parameter indicates whether JavaScript scripts can be executed on mongod. For security purposes, the default value is false, indicating that JavaScript scripts cannot be executed on mongod, and the mapreduce and group commands cannot be used.

  • disableJavaScriptJIT

    The default value is true.

    This parameter indicates whether to disable JavaScript JIT compilation. JavaScript JIT compilation enables just-in-time (JIT) compilation to improve the performance of running scripts.

    disableJavaScriptJIT: The default value is true, indicating that the JavaScriptJIT compiler is disabled. To enable JavaScript JIT compilation, set disableJavaScriptJIT to false.

  • operationProfiling.mode

    The parameter value is slowOp by default.

    This parameter indicates the level of the database analyzer.

    This parameter supports the following values:

    • The default value is slowOp, indicating that the collector records statements whose response time exceeds the threshold.
    • The value off indicates that the analyzer is disabled and does not collect any data.
    • The value all indicates that the collector collects data of all operations.
  • operationProfiling.slowOpThresholdMs

    The default value is 500 and the unit is ms.

    This parameter indicates the threshold for slow queries in the unit of ms. Queries that take longer than the threshold are deemed as slow queries.

    Unless otherwise specified, setting the value to 500 ms is recommended.

  • maxTransactionLockRequestTimeoutMillis

    The value ranges from 5 to 100, in milliseconds. The default value is 5.

    This parameter specifies the time for a transaction to wait for locks. If the time is exceeded, the transaction is rolled back.