--production vs build

Hey all, trying to get to understand WHY EXACTLY --production should not be used?

I have been running an app like this for an entire year, with great success and speed. I’m only now getting ready to build my mobile/desktop apps, and so I’ll probably get around to setting up a node server and stuff, but its such a chore.

So why, technically, is --production bad? It still bundles the app code.

When you run your app using the --production flag there is still all of the overhead of the environment that Meteor provides. File watching, shell server, mongo server, build plugins etc. etc. The flag is basically just a simulation of how your app will behave when all of the js and css is concatenated and minified. You’ll still have the resource overhead of running meteor and then meteor running your app and everything else it does. This may not seem like a lot but the meteor tool consumes quite a bit of memory and even when it’s not doing much it still uses valuable CPU resources. It’s probably not an issue if you only have a few dozen users of your app, and you have dedicated hosting, but if you’re on a shared host, especially something like a t2.nano, you’re gonna need to build your app for production. If not you’ll consume all your RAM before you even get the meteor tool to finish building.

3 Likes

AMAZING ANSWER.

Thanks a lot man! This is so, super relevant to what I’m doing right now. I bought my own little server here for $500 CAD from a buddy, good little unit. Moved from my Google Cloud Compute to localhost host here and got a MASSIVE performance boost, all the while just --production’ing.

Next I’m going to setup my own MongoDB instances and cluster those up… yay.

I am a very performance heavy person, as I’m mathing to scale. My game is also FINALLY working, but still kind of piggish on resources. I think I’ll do a report on running 4 Meteor --production apps VS true node servers. I’m very interested in that now! Thanks.

Just as soon as I finish building for Meteor Desktop, iOS, Android, WIndows, Mac… yeeeesh

1 Like