Or at least provide a way to disable MongoDB journaling when running the included examples.
With the current MongoDB settings, three prealloc files each about 1GB are created in ~/src/meteor/leaderboard/.meteor/local/db/journal. These files are not deleted when the example is terminated. I think 9 GB of diskspace for just 3 examples is way too much, although I understand these are the effect of the MongoDB defaults.
I could not find any mongodb.conf file related to Meteor. Perhaps I am missing some configuration options Meteor already provides when executing meteor run? As a temporary solution I modified app/lib/mongo_runner.js to include the mongodb --nojournal parameter in the launch_mongo function.
If there are no side effects to the "--nojournal" param then I suggest rolling this urgently.
Mongo preallocate 5% of disk space (complete disk space, not only used disk space), so if you have 500Gb of disk each new DB preallocate 25Gb of space (and spend a lot of time to start, because it write 25Gb of data on disk). Mongo can be run with a specific config file, i suggest to add a settings to indicate config file (and write a default config file) so each user can change settings without rewrite meteor core library.
MongoDB Configuration parameter is
Well said mavimo, Looks like --noprealloc would be a good default config to run when in testing.
--nojournal doesn't seem to be relevant to size but I might be wrong but again on test this would be great.
I suggest having a dbconfig file in .meteor directory but also a default too that turns off this size of DB, production environments can then change the dbconfig file as they choose.
Side effect: Just discovered that meteor mongo does not work anymore when running mongodb with --nojournal.
Also, using --noprealloc seems to have no effect on my system, gigs of diskspace are allocated.
You can try to use:
to set pre-allocation space size (32M).
Nice catch! I've added --smallfiles to the default mongo flags. This brings down empty project usage down from 200MB to 1MB on my machine. The fix will go out next release.
If you want to run meteor against a custom mongo, just specify the MONGO_URL environment variable when you run meteor. It will skip all the mongo startup jazz and use your mongo.