Is there a way to prevent mongod from pre-allocating these 100 MB files in journal folder?
WiredTigerPreplog.0000000001 WiredTigerPreplog.0000000002
I want journaling to be enabled.
Is there a way to prevent mongod from pre-allocating these 100 MB files in journal folder?
WiredTigerPreplog.0000000001 WiredTigerPreplog.0000000002
I want journaling to be enabled.
I often need to run test instances of mongod, and these preallocated WiredTiger journal (log) files just waste 200MB each time.
They can disabled by adding this parameter to your mongod
command line:
--wiredTigerEngineConfigString 'log=(prealloc=false)'
Or this to your mongod.conf
file:
storage:
wiredTiger:
engineConfig:
configString: log=(prealloc=false)
Of course this should never be done in production, and only when testing things that are unrelated to journalling. Journal file preallocation is a deliberate performance feature, which is almost always a win in the real world (and so is why it defaults to true
).
Find below some notes from MongoDB Documentation for Journaling
The preallocation can be avoided using only for MMapv1 storage engine using --noprealloc option when starting the mongod. But this is not applicable for
wiredtiger
storage engine.few more references
Meaning of WiredTigerPreplog files