Why does Meteor v0.4.x (MongoDB?) Use ~ 3GiB of disk space for a very simple application?

UPDATE : this has been fixed since Meteor v0.4 (2012). For historical purposes:


I am testing Meteor on a micro EC2 Ubuntu 11.10 (8GiB) instance, and after installing it and logging in, I ran the df command to find out how much memory was used by the main files (about 10%):

 Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8256952 782068 7055456 10% / udev 295276 4 295272 1% /dev tmpfs 121248 148 121100 1% /run none 5120 0 5120 0% /run/lock none 303112 0 303112 0% /run/shm 

After installing NodeJS and NPM, I ran df again to determine how much more room was occupied, and that didn't look much (extra 2%):

 Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8256952 919444 6918080 12% / udev 295276 4 295272 1% /dev tmpfs 121248 148 121100 1% /run none 5120 0 5120 0% /run/lock none 303112 0 303112 0% /run/shm 

Then I went about installing MongoDB, and as expected, it took up a lot more memory (59% of the disk space used):

 Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8256952 4585884 3251640 59% / udev 295276 4 295272 1% /dev tmpfs 121248 148 121100 1% /run none 5120 0 5120 0% /run/lock none 303112 0 303112 0% /run/shm 

However, by installing Meteor, curl install.meteor.com | /bin/sh curl install.meteor.com | /bin/sh creating a myapp sample from my site meteor create myapp and running myapp cd myapp and meteor , I successfully saw an application in the browser displaying "Hello World" (etc.), on the terminal side I saw this:

 [[[[[ ~/myapp ]]]]] Initializing mongo database... this may take a moment. Running on: http://localhost:3000/ ^C 

After closing the server, I checked df for the last time and was surprised to see the disk completely !?

 Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8256952 7778748 58776 100% / udev 295276 4 295272 1% /dev tmpfs 121248 148 121100 1% /run none 5120 0 5120 0% /run/lock none 303112 0 303112 0% /run/shm 

My question is: why does Meteor (MongoDB?) Take up ~ 3GiB disk space for a very simple application?

Is there a way to reduce this disk space consumption?

Thanks!

+6
source share
3 answers

This is fixed on the meteor development branch and will be in the next release.

https://github.com/meteor/meteor/commit/6042b91a9ca75fc47b2477e613da093f1c9b943e

Mongo seems to use huge files by default, and he should be told not to. It’s clear that for the common case of using mangoes, I suppose. By pre-distributing large files, they can improve performance in some cases.

+10
source

MongoDB preallocates 3GB for its log on first start. The meteor should probably disable this in design mode by default.

+5
source

The reasons for this large distribution and workaround were discussed in this thread. Check the --noprealloc option and it works great.

0
source

Source: https://habr.com/ru/post/913284/


All Articles