Hey, folks.
Mainly, I'm looking for some guidance here. A couple months ago the
buzz around Rails become too much for me, and I finally decided to
give in and learn the framework. This was all very new to me – most
of my focus in the past couple years has been solely in design with
static XHTML + CSS. I dabbled in PHP, but nothing significant.
Well, I love Rails, and it opened me up to Ruby, as well as other
scripting languages. Getting it all up and running on my development
machine (my laptop) as well as a newly acquired VPS for production
has also been a blast, and a tremendous learning experience. I knew
next to nothing about UNIX prior to this, other than that OS X runs
on top of it
Anyway, to my question: when is a site too small for Rails? I'm
really interested in doing web development for a living, and trying
very hard to be self-taught at it. I do have a day job right now, so
the freelance projects I’ve picked up so far (only one of them is
actually in production right now) have been for pretty small sites
that, I think, could easily be made into static HTML plus something
in the backend for administrivia. But should they be? The site I
have in production right now is for a local restaurant, and I made it
in Rails. It has just three sections, plus an admin backend for some
basic CMS functionality. If you’d like to get a feel for the site,
see it at http://wasabifusion.com. Developing the site with Rails was
seriously easy, and a lot of fun. The CMS functionality was simple,
and I was able to spruce it up quite a bit with some conservative use
of the scriptaculous AJAX helpers.
But here's my problem ... deployment has been not-so-simple.
Originally I deployed it on Dreamhost, and have had issues with
that. One major issue I’ve encountered is that my dispatch.fcgi
processes seem to like to multiply in the night. Usually they
multiply to around five, and at 25megs or so each, that’s a lot of
RAM! I’m a nice guy. I don’t want to do that to the rest of the
people on my Dreamhost server. I’ve come to the conclusion that they
multiply because eventually they’ll get stored into swap, and then a
request comes along for the website, but before the process can be
resurrected into real memory, the request times out and another
process is spawned. This may be wrong, but it’s annoying regardless,
and what it means for my visitors is that they’ll have to wait for
the whole framework to load again if they visit a few hours after
anyone else.
Before I considered how much RAM each fastcgi (or Mongrel, for that
matter) process would take up, I thought that a VPS would be the
solution to this. I was quite wrong. I have a VPS now with 160MB of
RAM at rimuhosting.com, which runs me $30 a month. Say that I do
quite well in my freelance business, and I get up to hosting more and
more sites. Eventually I’m going to bust that amount of RAM (and the
maybe the bandwidth allocation, too, as it’s puny compared to
Dreamhost’s)… so it would seem that a VPS isn’t going to be viable
if I want to do ALL of my sites in Rails.
I've decided that I've been shortsighted in thinking I can do all of
my sites in Rails. The restaurant site, right now, probably only
gets 10 unqiue visitors a day. Some of you may laugh when you hear
that I chose Rails to do a site like with that low amount of traffic,
but I simply didn’t know any better at the time. So my question you
then, smartypants, what should I have done? I like how simple the
CMS backend was to create with Rails. I want to be able to offer
that to all of my clients. I’ve invested a lot of time into Rails,
so I hate to leave it and learn something like PHP to write all my
small sites from scratch. Maybe there’s another PHP/Python/Ruby/
whatever framework out there I can use? Maybe I can use Rails simply
for the backend and have it generate everything staticly on each change?
I'm open for any advice at all. Sorry for the long introduction,
but I felt it might help
-Brent