Hosting web apps question

8 views
Skip to first unread message

Allen Maxwell

unread,
Oct 16, 2015, 6:11:10 PM10/16/15
to ur...@googlegroups.com
Hi Folks,

Quick question. I set up a digital ocean server and am hosting a website on it. I also have a couple other sites that I may want to pull off of heroku. None of the sites have much traffic at all and the databases are pretty small as well (postgres).

Other than trial and error, how many sites can a single server handle reliably? Any good ‘rules of thumb’ or info I can use to come to a good decision on this? As I said, none of them will have a lot of traffic.

Any advice would be appreciated!

Thanks in advance,

Max




Mister Ed

unread,
Oct 16, 2015, 6:27:22 PM10/16/15
to ur...@googlegroups.com
It is relative to the resources available: bandwidth, CPU, memory, etc
as well as what is running and how much traffic. I cannot speak as to
Digital Ocean as I roll my own. I assume a virtual situation where you
are not on a dedicated environment but might have some dedicated resources.

For illustration purposes here is what my smallest and oldest server
handles right now:

3 heavy use sites (traffic I cannot disclose but the sales exceed $1MM
per month each with an average of $70 per order. Not amazon by any
stretch but still decent sized for mom-and-pop type sites.

Approx 24 medium sites in traffic

168 other sites that are considered small with low traffic.

The server is 7 years old, 4 cores, and only 8GB ram.

So my guess is that you would likely be okay with your proposed use.

Mister Ed

Charles Wood

unread,
Oct 16, 2015, 7:41:48 PM10/16/15
to Utah Ruby User Group
For some of the smaller apps I've built, I've done a 1GB app and then set up some swap to get passenger installed. 


--
http://utruby.org
http://groups.google.com/group/urug

please prefix the subject with [JOB] when regarding job opportunities
--- You received this message because you are subscribed to the Google Groups "Utah Ruby Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urug+uns...@googlegroups.com.
To post to this group, send email to ur...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Moss

unread,
Oct 17, 2015, 12:11:52 AM10/17/15
to ur...@googlegroups.com
I think in this situation you will be memory-bound when you are running your apps... CPU and everything else become a factor as your traffic increases, but there is essentially zero overhead for a basic web app other than RAM being kept warm.

A Ruby on Rails 1.0 app used to start at about 150-200mb per app instance, starting from scratch, and then the instance would grow in size to a point, depending on how many objects your app allocates... Often there were memory leaks and you had to recycle them periodically.

These days even a Ruby on Rails app (4.2+) uses much less RAM (maybe 80mb+?), the un-changing app data can be shared (via Copy-On-Write) and you can have each process handle multiple connections (when it's IO-bound due to the interpreter locking) so things in my view became much more efficient at the software level over time, mainly looking at Rails.

If you were going to go off of one number I'd look at how much RAM you are using per app instance (a puma process in my case), considering you need 1 or more running ruby instances per "app", you are probably looking at 200-300mb per running Rails application. You could obviously take steps like to cram more functionality into fewer apps, or use a smaller app framework, but that would be a good rule of thumb to start: maybe 4 or 5 simple Rails apps per 1GB server?

-Jeff
--
http://utruby.org
http://groups.google.com/group/urug

please prefix the subject with [JOB] when regarding job opportunities
---
You received this message because you are subscribed to the Google Groups "Utah Ruby Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urug+uns...@googlegroups.com.
To post to this group, send email to ur...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Sent from Gmail Mobile

Michael Ries

unread,
Oct 17, 2015, 12:40:32 AM10/17/15
to ur...@googlegroups.com
I personally use a reserved T1 micro instance on Amazon AWS. It only has 384MB of RAM and costs me ~$5/month. I run 4 sites off of it. Three of them run in docker containers and the fourth is just flat files served by nginx (my blog). I haven't had any issues so far with performance or reliability (2 years into this specific setup).

I would agree with Jeff that you will probably hit the memory bounds before anything else if you are using Rails. Sinatra / Roda / Rack apps weight quite a bit less. I'm also using Elixir for a few of my sites and a single instance weighs in at ~25MB of RAM.
Reply all
Reply to author
Forward
0 new messages