set parameter on the mongodb .conf fails to start eh server

I think you’re trying to increase the eviction threads in MongoDB 7.0.14 by setting the wiredTigerEngineRuntimeConfig parameter. While the db.adminCommand() command works temporarily, it does not persist across restarts. This happens because the setParameter command is not stored in the configuration file by default. To make these changes persist, you’ll need to modify the MongoDB configuration file (mongod.conf) directly.

Here’s how you can do this:

  1. Edit the mongod.conf file: Add the wiredTigerEngineRuntimeConfig setting directly under the storage section. This will make the setting persistent across restarts.Your updated mongod.conf should look like this:
storage:
  dbPath: "C:\\Program Files\\MongoDB\\Server\\7.0\\data"
  wiredTiger:
    engineConfig:
      eviction:
        threads_min: 8
        threads_max: 16

systemLog:
  destination: file
  logAppend: true
  path: C:\\Program Files\\MongoDB\\Server\\7.0\\log\\mongod.log

net:
  port: 27017
  bindIp: 0.0.0.0

replication:
  replSetName: replocal

Verify the Changes: After restarting, you can check if the eviction threads have been applied by connecting to MongoDB and running the following command:

db.adminCommand({ getParameter: 1, wiredTigerEngineRuntimeConfig: 1 })

Hope this helps… let us know.

1 Like