Using db.adminCommand to set the wiredTigerEngineRuntimeConfig parameter does not take effect

Since the cache_size and threads_min parameter values are set to a small value, consider increasing them and use the following method to set them, but it does not work.

shard1:PRIMARY> db.adminCommand({“setParameter”: 1, “wiredTigerEngineRuntimeConfig”: “cache_size=5G”})
{
“was” : “”,
“ok” : 1,
“$gleStats” : {
“lastOpTime” : Timestamp(0, 0),
“electionId” : ObjectId(“xxxxxx”)
}
}
shard1:PRIMARY> db.adminCommand({getParameter: 1, wiredTigerEngineRuntimeConfig: 1})
{
“wiredTigerEngineRuntimeConfig” : “”,
“ok” : 1,
“$gleStats” : {
“lastOpTime” : Timestamp(0, 0),
“electionId” : ObjectId(“xxxxxx”)
}
}

mongodb version 3.4.10

Hi @xinbo_qiu,
I premise that I have never set it via administrative command, so I will make some observations.

  1. I didn’ t find command in the documentation for the version 3.4:

MongoDB Server Parameters — MongoDB Manual

For example, instead in version 7.0 it is present:

  1. The command seems to have been correctly applied, because you were returned ok: “1,” as is also said by the documentation:
  1. From the following command you can find the value “maximum bytes configured” which should correspond to the value you are trying to set :

    db.serverStatus().wiredTiger.cache
    
  2. I, personally would set it in the configuration file so that the change is persistent. From the documentation:

Configuration File Options — MongoDB Manual

I hope it is useful!

Regards

I find command in the documentation for the version 3.4:

db.serverStatus().wiredTiger.cache display the “maximum bytes configured” set is successful
“maximum bytes configured” : 5368709120,

1 Like

Hi @xinbo_qiu,

You’re right.

Perfect!

So, I think you can flag the solution.

Regards