Uploaded 18 meteor apps to single VPS - and it works! :)

OK fixed: somewhere in copy&paste between worlds, quote characters are lost, correct setting is:

server {
 listen 80;

 server_name example-minimal.meteorfarm.com;

location / {
 proxy_pass http://localhost:3002;
 proxy_http_version 1.1;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
 proxy_set_header Host $host;
 proxy_cache_bypass $http_upgrade;
 }
}

Thanks! :slight_smile:

Did you consider switching to phusion passenger?

Your set up requires all 18 apps to be running, but if you use passenger, you can set the minimum number of instances per app (as well as max instances) such that some always stay on and other unused ones can be turned off and back on when requested.

Phusion passenger: interestingā€¦ but I am not sure do I need it.

BTW, I didnā€™t found pricing table on their site (or my tired dev eyes cannot see it? :slight_smile: ).

Current server (VPS, 2-core/2GB RAM, 50GB SSD) costs me ~10 USD/month https://www.hetzner.de/gb/hosting/produkte_vserver/cx20 and works fine with 18 example apps.

Problem is that same server also builds android .apk for http://www.meteorkitchen.com and http://example-human2machine.meteorfarm.com and when running that android build tools uses too much resources and slows down the server.

Without android build thing, $10 USD VPS works perfectly with 18 apps (I donā€™t have a lot of trafic there).

It is free. There is an enterprise version which you wont need.

The point is, it helps you with server utilization and density. You can get a smaller server or more visitors on this one. You could decrease your swap usage, perhaps even eliminate it.

As such, you could be less affected by those builds and the builds could complete in less amount of time. You could deploy 28 apps and still use less ram.

You get sticky sessions for free. If one app suddenly gets high traffic, it autoscales that app to multiple instances.

Of one app crashes, it intelligently restarts that single app and not take down the whole server

It uses te nginx config files (it is tightly integrated into your nginx) so your configurations are reused

And the list goes on and on.

Iā€™ve done something very similar

  • Ubuntu 14.04 on Digital Ocean
  • HAProxy (instead of nginx)
  • nvm & pm2 (instead of mupx & docker)

Currently running 6 Meteor sites and 4 vanilla node workers on a 512mb (with 4gb swap) with no issues yet.

4 Likes

where was the hosting done? Digital Ocean?

Hosting: Hetzner.

This server: https://www.hetzner.de/gb/hosting/produkte_vserver/cx20 (btw, currently Iā€™m running 20 apps).

They are concurrent with the price, but from other peopleā€™s experience serious backup is a must.

Thank you! Where /how do you back up?

Nothing important there - just a hobby project, so I actually donā€™t have a backup. If something bad happens, I can setup server and deploy apps again in 2-3 hours.

I told you for backup just in case youā€™ll use it for something more important - be careful.

BTW, they offer backup space too for few bucks.

Have you documented the process at all? Any resources that could assist in getting started? Any Meteor or MongoDB specific issues / processes to keep in mind?

Kind of related, but perhaps not really ā€“ has anyone had any issues with proxy_pass not working when using kadirahq:mup? Iā€™m not sure if Docker has got anything to do with it.

Whenever I try to hit http//www.my-app.com, I get an error - connection refused. I can access the app perfectly fine at http://www.my-app.com:#### (where #### is the port itā€™s running on).

Basically have got the same server blocks as referenced above.

I had a moment of stupidity, and in my server block definitions i was giving:
server_name my-domain.com
-and not-
server_name my-domain.com www.my-domain.com

Obviously hitting www.my-domain.com in a web browser would load nothing without it being defined.

Just sharing so all the Googlers out there can have that awkward, ā€œwell, duh meā€ moment too. :grin: