Reputation: 6295
Our MongoDB is currently sitting at about 1.2TB. We have 2TB total disk space on the server, and within one evening it created a few 2GB data files, using up all the disk space and crashing the process.
When I looked at the data files, I noticed that it preallocates a few of these files every couple of days, at one point generating more than 140GB of files.
How can I control this?
Upvotes: 2
Views: 112
Reputation: 5898
If you want to control the size of the generated data files you have the following options available to you when starting mongod
:
--smallfiles
to decrease the initial data files size and limit it to a maximum of 512MB [--smallfiles Manual Reference]
--quota
and --quotaFiles
to adjust the maximum number of data files allowed per MongoDB database
[--quota Manual Reference]
Upvotes: 3