Suggested Rails Architectures (OS/Webserver/Other Languages)

I would like to preface my question by point out that I am not a
programmer by trade and that my experience is limited to things I have
learned over the years in the development of my full auction, forum and
accounting engines. (I run a niche auction site that is about a decade
old and has about 50,000 members – all on software I wrote from
scratch).

For five years now, I have been running entirely on Perl and Postgresql
on Apache 1.3, on Debian. My entire site infrastructure is probably
closing in on 20,000 lines of perl code and it has been unweildly for a
couple of years. I have slowly worked on re-writing everything in a more
logical and thorough manner, but every time I get a significant portion
of the project completed, I realize what a mess it is still going to be.
Frankly, as everyone knows - perl is a great tool to shoot yourself in
the foot. Especially if it’s the first and only language you really know
very well. And that has been my problem.

So, I am finally deciding to step out to something else. I have chosen
to investigate Ruby, because I think Ruby on Rails will give me the
flexibility I need to write complex applications and systems without
spending enormous quantities of my life coding them and maintaining
them. That gives this one-man-operation the freedom to invest his time
in other things my site desparately needs my time for.

I have spent several days trying to find answers to some particular
questions without success, so I appeal to the more experienced members
of this list to impart some wisdom on me and guide me in the decision
making process.

As I mentioned, almost everything I do now is in Perl on Apache 1.3 on
Debian. I also use third-party applications based on PHP and Python.

I believe I will need my web server to allow for PHP, Python, Perl and
Ruby functionality, since I won’t be running 100% of either of the four.

And therein lies the problem. I am now unsure of what web server to use
and whether I should stick with my old friend - Debian.

As far as the OS:

I have been exclusively Debian (currently Etch) for over five years now
and have not played much with other distros in that time. While I prefer
staying with Debian, I have read a number of things (including the whole
fiasco with the Debian packaging team complaining about rubygems and the
FHS) that lead me to be completely confused on whether to use the strict
apt-get rails package, rubygems, both, completely hand-installed setup,
etc. It seems like getting a fully functional deployment that won’t
break in the near future on Debian is a headache and I’m wondering what
people would suggest here. Are the problems and concerns significant
enough that I should really think of moving off of Debian?

As far as the Web Server:

I first read in a number of places that Ruby on Rails had performance or
threading problems on Apache2 that made it a bad choice and that it was
better to stick with Apache 1.3. On the other hand, every installation
tutorial I have found only covers installation of Ruby on Rails with
Apache2. So - which is the preferred web server for Ruby on Rails
development?!

Additionally, I need to be able to run perl, PHP and perhaps python as I
mentioned before. I have only ever used Apache 1.3, but my understanding
regarding perl is that it requires significant to major alterations for
each piece of perl software to be ported over to Apache2. I don’t want
to rewrite software - mine or anyone elses.

I’m also a bit stymied by some warnings I seem to have read around the
net in comments about ruby on rails, as far as performance. How does
this compare to Perl? Believe it or not, my main site application that I
wrote does not use mod_perl. So it uses more resources (though I do
spread the database end out with pg_pool for a little help). However, I
have no problem serving enough requests to handle dozens and dozens of
visitors at a time with a database-heavy site.

With Ruby on Rails, is there some sort of a problem with running
multiple applications and services off the same server? And I know that
poorly written perl being run under mod_perl can cause session/state
issues and even “contamination” issues. Is that a risk with Ruby on
Rails?

I appreciate your time for reading this lengthy request and offering
your advice. I am really looking forward to getting things underway, but
my situation doesn’t call for just installing whatever all-in-one bundle
and being on my merry way. I want to do things right from the start and
get on to programming and seeing what all the excitement is about.

If you could help direct me toward what kind of environment I should
look at considering, I would greatly appreciate it.

Regards.

On Sep 2, 2006, at 3:51 PM, Cron Job wrote:

I would like to preface my question by point out that I am not a
programmer by trade and that my experience is limited to things I have
learned over the years in the development of my full auction, forum
and
accounting engines. (I run a niche auction site that is about a decade
old and has about 50,000 members – all on software I wrote from
scratch).

Congratulations. I know many programmers by trade that have never made
it as far as you have!

So, I am finally deciding to step out to something else. I have chosen
to investigate Ruby, because I think Ruby on Rails will give me the
flexibility I need to write complex applications and systems without
spending enormous quantities of my life coding them and maintaining
them. That gives this one-man-operation the freedom to invest his time
in other things my site desparately needs my time for.

Have you considered having a development team write the application for
you so you can indeed spend time on more important business matters?

My company, Quality Humans, Inc (http://www.qualityhumans.com) and our
spin-off-in-the-making Engine Y. (http://www.engineyard.com) cater to
customers such as yourself: Entrepreneurs with technical businesses. We
have two very complete teams ready to work on your application and,
if you choose, host it as well.

I believe I will need my web server to allow for PHP, Python, Perl and
Ruby functionality, since I won’t be running 100% of either of the
four.

Not necessarily. Each of these languages can be handled externally via
proxying, so you could set up 4 (or more) web servers, one or more for
each language, and have a master web server in front sending requests
to the correct back end server or servers. I speak of everything in the
plural, as Engine Y. is a more-than-one-of-everything architecture
designed to prevent outages in the case of a failure.

And therein lies the problem. I am now unsure of what web server to
use
and whether I should stick with my old friend - Debian.

You could. I highly recommend using the Xen hypervisor to create virtual
machines for each function on your site, regardless of the number of
servers you might actually use in the final configuration. Doing so will
allow pain free upgrades to more machines and more modern hardware in
the
future. All Engine Y. servers are configured in this manner and
additionally have access to shared cluster storage (fully redundant, of
course, like everything else at Engine Y.).

FHS) that lead me to be completely confused on whether to use the
strict
apt-get rails package, rubygems, both, completely hand-installed
setup,
etc. It seems like getting a fully functional deployment that won’t
break in the near future on Debian is a headache and I’m wondering
what
people would suggest here. Are the problems and concerns significant
enough that I should really think of moving off of Debian?

I firmly believe that Gentoo is the ultimate Linux distribution. It’s an
incredibly difficult distribution to get started on, but it’s
flexibility
and management are simply phenomenal. The supports and encourages the
creation of your own distribution(s) fully customized and optimized
for
each and every task.

As far as the Web Server:

I first read in a number of places that Ruby on Rails had
performance or
threading problems on Apache2 that made it a bad choice and that it
was
better to stick with Apache 1.3. On the other hand, every installation
tutorial I have found only covers installation of Ruby on Rails with
Apache2. So - which is the preferred web server for Ruby on Rails
development?!

Currently, I think the best solution by a substantial margin is
Apache 2.2.x
with mod_proxy and mod_proxy_balancer distributing to mongrel_cluster
for
dynamic requests. There are certainly other solutions, but this
configuration
is known stable and secure and is providing very close to the highest
performance available.

Additionally, I need to be able to run perl, PHP and perhaps python
as I
mentioned before. I have only ever used Apache 1.3, but my
understanding
regarding perl is that it requires significant to major alterations
for
each piece of perl software to be ported over to Apache2. I don’t want
to rewrite software - mine or anyone elses.

Here again, it’s no problem to run several web servers behind a master
proxy server. I’d highly recommend this approach rather than getting
into
porting your code to a newer architecture where you don’t feel the need.

I’m also a bit stymied by some warnings I seem to have read around the
net in comments about ruby on rails, as far as performance. How does
this compare to Perl? Believe it or not, my main site application
that I
wrote does not use mod_perl. So it uses more resources (though I do
spread the database end out with pg_pool for a little help).
However, I
have no problem serving enough requests to handle dozens and dozens of
visitors at a time with a database-heavy site.

There are sites serving millions of requests per day on Rails, including
the 37Signals folks, Penny Arcade, and Pitchfork Media.

On modern hardware, performance of Rails is more than adequate for just
about any website. And, there are major improvements in the pipeline as
well.

Most benchmarks show Ruby to be overall about 30% slower than other
dynamic languages. That sounds substantial, but isn’t really a concern
for most applications, since hardware will be 30% faster than it is
today in about 6 months. :slight_smile:

With Ruby on Rails, is there some sort of a problem with running
multiple applications and services off the same server? And I know
that
poorly written perl being run under mod_perl can cause session/state
issues and even “contamination” issues. Is that a risk with Ruby on
Rails?

Unlikely, particularly so if you use configurations like those mentioned
above.

I appreciate your time for reading this lengthy request and offering
your advice. I am really looking forward to getting things
underway, but
my situation doesn’t call for just installing whatever all-in-one
bundle
and being on my merry way. I want to do things right from the start
and
get on to programming and seeing what all the excitement is about.

We’d love to help you get from here to there, in any way that would
be of
value to you.