Allow for configuration of MongoDB #15

zwippie opened this Issue Apr 11, 2012 · 7 comments


None yet

5 participants

zwippie commented Apr 11, 2012

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.

mpj commented Apr 12, 2012

Whoa. +1


If there are no side effects to the "--nojournal" param then I suggest rolling this urgently.

mavimo commented Apr 12, 2012

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.

zwippie commented Apr 12, 2012

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.

mavimo commented Apr 12, 2012

You can try to use:

--oplogSize 32

to set pre-allocation space size (32M).

n1mmy commented Apr 13, 2012

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.

@n1mmy n1mmy closed this Apr 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment