Hello all,
coming from PHP and recognized benefits both Ruby and Rails brings, I am
tempted to use Rails platform even for smaller websites with several
visitors. However, I am little concerned about hosting for this really
small web applications because Rails framework require 20-30MB of RAM
and simple math would reveal that it is inpossible to host 200-300 Rails
websites on one server like hosting providers do with PHP. I am maybe
wrong how fcgi works, but this also brings question if it is even good
job to buy shared hosting for PHP from provider who offer Ruby on Rails.
I would appreciate any thoughts and experiences on this subject.
Bojan
Bojan Mihelac wrote:
Hello all,
coming from PHP and recognized benefits both Ruby and Rails brings, I am
tempted to use Rails platform even for smaller websites with several
visitors. However, I am little concerned about hosting for this really
small web applications because Rails framework require 20-30MB of RAM
and simple math would reveal that it is inpossible to host 200-300 Rails
websites on one server like hosting providers do with PHP. I am maybe
wrong how fcgi works, but this also brings question if it is even good
job to buy shared hosting for PHP from provider who offer Ruby on Rails.
I would appreciate any thoughts and experiences on this subject.
Bojan
anyone? hosting providers? any answer?
I would agree that you cannot host 200-300 Rails applications on one
server
as you can with PHP.
With the time you save writing those 300 applications you can, however,
afford more servers. 
IMHO, of course!
Nick Snels wrote:
Hi Bojan,
a good place to start if you are looking for a Rails hosting company is http://www.railshostinginfo.com . There you can compare and review many of the better known Rails hosts.
Kind regards,
Nick
thanks for answer Nick, but I do not evaluate hosting companies (already have both shared server and VPS).
The questions I look for answer are:
1. is it possible to host very small Rails sites on shared server and get decent performance (as you can get with PHP)?
2. if thats not option how many small Rails apps you can put on VPS, with for example 256MB RAM
3. if 1. is not possible, then it brings me to question if it is smart for user to buy PHP hosting from companies offering RAILS and PHP on same server as performance of PHP would be problematic as well
Tom Mornini wrote:
I would agree that you cannot host 200-300 Rails applications on one server
as you can with PHP.
With the time you save writing those 300 applications you can, however,
afford more servers. 
IMHO, of course!
hey Tom, I couldn't agree more with you that less time to develop would justify higher hosting price. That's why I want to put smaller apps on rails as well 
But how many apps you can host on server? I am thinking about really small apps. 30-40?
And is then true that buying shared server space for hosting rails apps sucks (even buying shared server space for hosting PHP apps if they offer rails hosting on same servers).
best regards,
Bojan
1. is it possible to host very small Rails sites on shared server and
get decent performance (as you can get with PHP)?
I've tried with fastCGI, it's a mess and not stable at all. If you are
on the edge (Apache2.2), use Mongrel and you'll have better results.
But it's complicated, I'm sure you agree, when you have already a
production server with several websites to be on the bleeding edge.
I'll try an upgrade to use Mongrel, but I have to prepare the field...
3. if 1. is not possible, then it brings me to question if it is smart
for user to buy PHP hosting from companies offering RAILS and PHP on
same server as performance of PHP would be problematic as well
I didn't notice problems of performance with php sites where I've
deployed my Rails app'.
Just my $0.02.
Pierre-Alexandre Meyer wrote:
1. is it possible to host very small Rails sites on shared server and get decent performance (as you can get with PHP)?
I've tried with fastCGI, it's a mess and not stable at all. If you are
on the edge (Apache2.2), use Mongrel and you'll have better results.
But it's complicated, I'm sure you agree, when you have already a production server with several websites to be on the bleeding edge.
I'll try an upgrade to use Mongrel, but I have to prepare the field...
I use Mongrel on VPS and it is not very complicated to setup (Rimuhosting have great howto article on this, you can check it out)
3. if 1. is not possible, then it brings me to question if it is smart for user to buy PHP hosting from companies offering RAILS and PHP on same server as performance of PHP would be problematic as well
I didn't notice problems of performance with php sites where I've
deployed my Rails app'.
Just my $0.02.
but it seems logic to me that even php sites would start to have problems once many rails apps on server start to consume RAM... or?
Bojan
I use Mongrel on VPS and it is not very complicated to setup
(Rimuhosting have great howto article on this, you can check it out)
I'm sorry, my english is so bad. I mean 'complicated' but I wanted to
say 'dangerous'. You know you have a production server whith 100 php
websites for 30 customers. You have tuned your Apache2.0.3-stable-rc12
configuration and so on.
You can't just rebuild Apache to have the 2.2 and restart it, whithout taking
care of not breaking your actual sites. So 'complicated' means you need
to read Apache changelogs, etc. It's just sysadmin work, not complicated
at all actually, but you have to be careful not to break your system and
loose your gentles customers 
but it seems logic to me that even php sites would start to have
problems once many rails apps on server start to consume RAM... or?
Sure. I've actually crashed a production server with fastCGI (kernel out
of memory...)
The point is, that the lack of performance for me is due to the reduced
number of cgi processes. I've reduced them to avoid another crash
(and I think the regular call to the GC speed low my app too).
Php websites are (surprisingly?) not at all affected.
Pierre-Alexandre Meyer wrote:
But how many apps you can host on server? I am thinking about really
small apps. 30-40?
I'm running Apache+FastCGI on a Servint VPS, and each dispatch.fcgi
process is using 19mb of memory. If your projects are *really* small,
maybe you can get away with one process per site. With 768mb of
guaranteed memory on a decent VPS (eg Servint's "Ultimate" package),
I'd say that 30 sites is possible. That drops you to $4/site/month,
which isn't outrageous.
Gwyn.
Gwyn Morfey wrote:
But how many apps you can host on server? I am thinking about really
small apps. 30-40?
I'm running Apache+FastCGI on a Servint VPS, and each dispatch.fcgi
process is using 19mb of memory. If your projects are *really* small,
maybe you can get away with one process per site. With 768mb of
guaranteed memory on a decent VPS (eg Servint's "Ultimate" package),
I'd say that 30 sites is possible. That drops you to $4/site/month,
which isn't outrageous.
Gwyn.
Thanks Gwyn for answer, thats clarify much questions I had.
Jake Janovetz wrote:
Gwyn Morfey wrote:
But how many apps you can host on server? I am thinking about really
small apps. 30-40?
I'm running Apache+FastCGI on a Servint VPS, and each dispatch.fcgi
process is using 19mb of memory. If your projects are *really* small,
maybe you can get away with one process per site. With 768mb of
guaranteed memory on a decent VPS (eg Servint's "Ultimate" package),
I'd say that 30 sites is possible. That drops you to $4/site/month,
which isn't outrageous.
Gwyn.
You also have to consider the merits of Rails for really small apps. I'm not sure exactly what you mean by really small app, but the truth is, if they're that small, perhaps Rails doesn't provide quite the productivity multiple you would expect.
As apps get larger (but not too large!), certainly the benefits of Rails becomes clearer. But for really tiny things, you'll have quite a bit of overhead in Rails. In particular, as you've noticed, with the server resources.
Also note that you need to consider the effects of having a single mongrel instance serving each app. Most folks are running multiple mongrels and using Apache's load balancer to keep things running smoothly.
Can you give me an idea of what "really small" is?
by 'small Rails apps' I meant applications with expected small traffic and only few concurrent users. For example personal wiki or personal blog.
best regards,
Bojan
> You also have to consider the merits of Rails for really small apps.
> I'm not sure exactly what you mean by really small app, but the truth
> is, if they're that small, perhaps Rails doesn't provide quite the
> productivity multiple you would expect.
I'm still mostly using PHP for the really small stuff - eg mostly
static html, with a couple of user-configurable pages. One option is
CakePHP, which lets you maintain some of Rails' design patterns
without the hosting headache.
Gwyn.