'How do I Increase WT allocation_size - MongoDB
On this [link] (https://source.wiredtiger.com/3.1.0/tune_page_size_and_comp.html) there is a note that allocation_size can be tuned between 512B and 128 MB
How do we modify that variable and start mongod process that will have allocation_size of 16KB for example, the default is 4KB ?
This does not work
replica1:PRIMARY> db.adminCommand( { "setParameter": 1, "wiredTigerEngineRuntimeConfig": "allocation_size=64KB"}){ "ok" : 0, "errmsg" : "WiredTiger reconfiguration failed with error code (22): Invalid argument", "code" : 2, "codeName" : "BadValue"}
replica1:PRIMARY> db.createCollection( "users", { storageEngine: { wiredTiger: { configString: "allocation_size=64KB" } } } ){ "ok" : 0, "errmsg" : "22: Invalid argument", "code" : 2, "codeName" : "BadValue"}
Solution 1:[1]
The way the parameter is being modified is correct. The error message is about a different issue. The parameters internal_page_max and leaf_page_max, whose default value is 4KB and 32KB respectively, have to be multiples of allocation_size. This has to be ensured when setting the allocation_size. So, in your case, you have to set the other two to at least 64KB if you are setting allocation_size to 64KB as shown below:
rs0:PRIMARY> db.createCollection( "users", { storageEngine: { wiredTiger: { configString: "allocation_size=64KB,internal_page_max=64KB,leaf_page_max=64KB" } } } ) {
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1595909936, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
},
"operationTime" : Timestamp(1595909936, 1) }
Source and example from: WT-6510
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
