[Catalyst] Why Catalyst instead of Ruby on Rails?

Perrin Harkins perrin at elem.com
Sat Nov 12 16:58:55 CET 2005


On Fri, 2005-11-11 at 22:09 -0800, Jake wrote:
> I was wondering -- just how do you scale Catalyst to serve truly large sites?
> 
> Hundreds of $3k+ Apache/mod_perl servers?

Not unless you're well within the top 100 most popular sites.  A medium-
sized site shouldn't need more than about 10 servers, even if it's
dynamic.

And, if you are in that world, after buying these hundreds of $3K
servers, you get an article in InfoWorld about how you saved millions by
not buying Sun.

> Apache may be the best but it isn't the fastest -- even in recently version.
> 
> Has anyone considered building a really fast HTTP server into
> Catalyst? I don't think Rails has that, does it?

The only thing you're likely to improve is static file-serving, which is
kind of outside the realm of Catalyst and Rails.  It would be fun to see
someone try squid, perlbal, and the other non-blocking servers as well
as a threaded Apache2 (threads are good for the static server, but not
for the mod_perl server), and see how much of an improvement they can
get for static files.  For dynamic stuff, most people wouldn't use a
non-blocking server because it would force you to rewrite DBI and every
other file and network module to support it.  Even Brad Fitzpatrick
(author of perlbal) says this.

> ESI: http://www.esi.org/overview.html

I think there are pretty good reasons why ESI failed to catch on.  It
has a number of things that slow it down.  It requires pages to be
parsed for tags before delivery (not compiled, like TT, but actually
parsed).  Then, if there are any non-cached includes, it adds additional
HTTP round-trips to the wait before page delivery.  It also caches at
the level of HTML chunks, rather than data objects or database results,
which means if you use the same data in multiple pages you have to cache
it multiple times.  In most cases, you'll be better off with a good
object cache in your application server and a caching proxy server in
front.

The win with ESI is if a customer in Prague requests a page with all the
includes cached from an Akamai server in Prague, when the source server
is in California.  That would probably be an improvement, due to the
network latency.  

An Apache::ESI module would be a fun project to build, and might be good
for marketing, but I don't think it would improve performance for most
sites over the other techniques.  Maybe easier integration with object
caching and page caching proxies would be a better way to spend the
effort.

- Perrin




More information about the Catalyst mailing list