Modifying Database Parameters
Purpose
Modify database parameters to improve database performance and reliability.
Procedure
Table 1 describes the tunable parameters in the database configuration file. The default configuration file is /etc/mongodb.cnf. After modifying the configuration file, restart the database for the modification to take effect.
Parameter |
Description |
Suggestion |
|---|---|---|
cacheSizeGB |
Upper limit of the memory used by the WiredTiger engine |
If only one MongoDB instance is deployed on a host, set this parameter to 60% of the memory. |
Oplog |
Size of the oplog used for MongoDB replication |
Set it to 5% of the available drive space. |
commitIntevalMs |
Interval for updating MongoDB journal logs |
You are advised to use the default value. A larger value indicates better performance but a higher probability of data loss. |
syncPeriodSecs |
Interval for flushing data to drives |
You are advised to use the default value. A larger value indicates better performance, at the expense of database reliability. |
noprealloc |
Whether to enable data file pre-allocation |
Recommended value: true |
noscripting |
Whether to enable the script engine |
Recommended value: true |
notablescan |
Whether to allow table scanning |
Recommended value: true |