问题
How to control the size of large journals files as journal file take large amount of space. How can the space can be saved using small files.
回答1:
After doing some research:
Setting smallfiles option for controlling journaling doesn't control the size
However the command is --smallfiles
回答2:
Here are some ways to control journal file size,
Use
--smallfilesoption in mongod which will use 128MB as max size of journal file instead of 1GBulimitis way in unix to control system settings. It will allow you to set max. file size in system. Consider this when you have sharding in place.Reduce
commitIntervalMsto a lower value i.e flush data to disk frequently. Use this option only when you can tolerate heavy IO load periodically.
来源:https://stackoverflow.com/questions/29632566/how-to-control-size-of-journals-in-mongodb