Hi
I’m thinking of the best way to deploy 10 websites on the same server. They will all have the same URL but each will have its own subdomain (ie, site01.company, site02.company,…)
My setup is this:
1 droplet on digitalocean ($40-$60 range)
3 deployments on compose.io (each deployment will have 3-4 databases)
The total users for all 10 URLs are about 1500-2000 people. There won’t be a lot of activities on the daily basis. Maybe a spike here and there.
Questions:
- Does anyone see anything wrong with this configuration?
- How do I make sure all cores are utilized? I saw the intructions on meteorhack on this but it doesn’t mention a scenario where many sites on sharing the same server
- Will it be easier to just deploy each site on its own smaller droplet?
Thanks!
Having done something similar, I would strongly recommend you NOT do this. We had 4 projects deployed on the same (pair of) servers and found that we either needed docker to aggressively limit the memory (which has its own problems) or one project would consume too much memory and slow down all the others. It’s much better to have each project on its own server where it has its own resources, safe from interference from the other meteor processes
Thanks. I’ll take your advice and deploy each site on its own webserver.
What about DB? Did you have to deploy each on seperate server?
Initially our apps shared one database - this is pretty much a requirement as each app is available for different types of users, e.g., staff vs administrators and we didnt want each app to have to package all the UI code for users that would never require it.
However, we ended up splitting the database into 4 parts by collection, as some of the collections had very heavy write loads which we didnt want all the servers to use. We then setup microservices to access the data on these collections.
I’d actually love to hear how other people handle this issue. Ultimately we’re going to move to a sharded cluster with dedicated shards for these “busy” collections, which is essentially what we’ve done - but without the shard server.
For 1500-2000 users, I think you’ll be absolutely fine putting it all on one server.
The easiest solution is to run them all on separate ports and use nginx to proxy requests through from each subdomain to the corresponding app running on a it’s port.
2 Likes