Skip to content
logo
Percona Server for MongoDB 6.0
Tune parameters
Initializing search
    percona/psmdb-docs
    percona/psmdb-docs
    • Home
    • Percona Server for MongoDB feature comparison
      • System requirements
      • Install Percona Server for MongoDB on Debian and Ubuntu
      • Install Percona Server for MongoDB on Red Hat Enterprise Linux and derivatives
      • Install Percona Server for MongoDB from binary tarball
      • Run Percona Server for MongoDB in a Docker container
        • Percona Memory Engine
        • Hot Backup
        • $backupCursor and $backupCursorExtend aggregation stages
        • Authentication overview
        • Enable SCRAM authentication
        • Set up LDAP authentication with SASL
        • Set up x.509 authentication and LDAP authorization
        • Setting up Kerberos authentication
        • AWS IAM authentication
        • Setting up AWS IAM authentication
        • LDAP authorization
        • Set up LDAP authentication and authorization using NativeLDAP
        • Data at rest encryption
        • HashiCorp Vault integration
        • Using the Key Management Interoperability Protocol (KMIP)
        • Local key management using a keyfile
        • Migrate from key file encryption to HashiCorp Vault encryption
      • Auditing
      • Profiling rate limit
      • Log redaction
      • Additional text search algorithm - ngram
      • Tune parameters
        • Parameters
          • cursorTimeoutMillis
          • failIndexKeyTooLong
          • internalQueryPlannerEnableIndexIntersection
          • ttlMonitorEnabled
          • ttlMonitorSleepSecs
        • Upgrade from 5.0 to 6.0
        • Upgrade Percona Server for MongoDB
      • Uninstall Percona Server for MongoDB
      • Release notes index
      • Percona Server for MongoDB 6.0.5-4 (2023-03-29)
      • Percona Server for MongoDB 6.0.4-3 (2023-01-30)
      • Percona Server for MongoDB 6.0.3-2 (2022-12-07)
      • Percona Server for MongoDB 6.0.2-1 (2022-10-31)
    • Glossary
    • Copyright and licensing information
    • Trademark policy

    • Parameters
      • cursorTimeoutMillis
      • failIndexKeyTooLong
      • internalQueryPlannerEnableIndexIntersection
      • ttlMonitorEnabled
      • ttlMonitorSleepSecs

    Percona Server for MongoDB parameter tuning guide¶

    Percona Server for MongoDB includes several parameters that can be changed in one of the following ways:

    • The setParameter admonitions in the configuration file for persistent changes in production:
    setParameter:
      cursorTimeoutMillis: <int>
      failIndexKeyTooLong: <boolean>
      internalQueryPlannerEnableIndexIntersection: <boolean>
      ttlMonitorEnabled: <boolean>
      ttlMonitorSleepSecs: <int>
    
    • The --setParameter option arguments when running the mongod process for development or testing purposes:
    $ mongod \
      --setParameter cursorTimeoutMillis=<int> \
      --setParameter failIndexKeyTooLong=<boolean> \
      --setParameter internalQueryPlannerEnableIndexIntersection=<boolean> \
      --setParameter ttlMonitorEnabled=<boolean> \
      --setParameter ttlMonitorSleepSecs=<int>
    
    • The setParameter command on the admin database to make changes at runtime:
    > db = db.getSiblingDB('admin')
    > db.runCommand( { setParameter: 1, cursorTimeoutMillis: <int> } )
    > db.runCommand( { setParameter: 1, failIndexKeyTooLong: <boolean> } )
    > db.runCommand( { setParameter: 1, internalQueryPlannerEnableIndexIntersection: <boolean> } )
    > db.runCommand( { setParameter: 1, ttlMonitorEnabled: <int> } )
    > db.runCommand( { setParameter: 1, ttlMonitorSleepSecs: <int> } )
    

    Parameters¶

    cursorTimeoutMillis¶

    Type: integer
    Default: 600000 (ten minutes)

    Sets the duration of time after which idle query cursors are removed from memory.

    failIndexKeyTooLong¶

    Type: boolean
    Default: true

    Versions of MongoDB prior to 2.6 would insert and update documents even if an index key was too long. The documents would not be included in the index. Newer versions of MongoDB ignore documents with long index key. By setting this value to false, the old behavior is enabled.

    internalQueryPlannerEnableIndexIntersection¶

    Type: boolean
    Default: true

    Due to changes introduced in MongoDB 2.6.4, some queries that reference multiple indexed fields, where one field matches no documents, may choose a non-optimal single-index plan. Setting this value to false will enable the old behavior and select the index intersection plan.

    ttlMonitorEnabled¶

    Type: boolean
    Default: true

    If this option is set to false, the worker thread that monitors TTL Indexes and removes old documents will be disabled.

    ttlMonitorSleepSecs¶

    Type: integer
    Default: 60 (one minute)

    Defines the number of seconds to wait between checking TTL Indexes for old documents and removing them.

    Contact Us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: December 7, 2022
    Created: December 7, 2022
    Percona LLC and/or its affiliates, © 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.