# Rails and Perl - Performance

**URL:** <https://www.ruby-forum.com/t/rails-and-perl-performance/71036>\
**Category:** Rails\
**Created:** [October 4, 2006, 9:27pm UTC](https://www.ruby-forum.com/t/rails-and-perl-performance/71036 "2006-10-04T21:27:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jessica\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@Jessica\_F](https://www.ruby-forum.com/u/Jessica_F)\
**Post date:** [October 4, 2006, 9:27pm UTC](https://www.ruby-forum.com/t/rails-and-perl-performance/71036/1 "2006-10-04T21:27:54Z")

</div>

First off, I’m not trying to ignite a language/tool war here.

mod\_perl configured correctly really can push out the pages.  
Apache + Mongrel (Cluster) configured correctly can push out the pages,  
but not to the extent of mod\_perl.

It it foreseable that we will see the same performance out of Apache and  
Mongrel as mod\_perl? Is LiteSpeed’s LSAPI server any faster than Apache

- Mongrel?

---

<div class="post-metadata">

**Author:** ![Jessica\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@Jessica\_F](https://www.ruby-forum.com/u/Jessica_F)\
**Post date:** [October 4, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/rails-and-perl-performance/71036/2 "2006-10-04T22:37:19Z")

</div>

On 10/4/06, Jessica F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> First off, I’m not trying to ignite a language/tool war here.
> 
> mod\_perl configured correctly really can push out the pages.  
> Apache + Mongrel (Cluster) configured correctly can push out the pages,  
> but not to the extent of mod\_perl.
> 
> It it foreseable that we will see the same performance out of Apache and  
> Mongrel as mod\_perl? Is LiteSpeed’s LSAPI server any faster than Apache
> 
> - Mongrel?

It’s completely unrealistic to expect that rails will be as mature as  
something like mod perl + template toolkit/Mason when it comes to  
performance. Any platform that gets widespread use improves over  
time, it’s pretty much a given. Also, you can’t compare mod perl  
directly to rails, they don’t fulfill the same purpose. Mod perl is  
probably more comparable to mongrel in the function it serves, with  
Template Toolkit/Mason being the template engine, and various other  
perl modules taking care of session management and database  
connections. And you have to put all these pieces together yourself  
and know a lot more about how everything works then you do with rails.

---

<div class="post-metadata">

**Author:** ![Jessica\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@Jessica\_F](https://www.ruby-forum.com/u/Jessica_F)\
**Post date:** [October 5, 2006, 6:59am UTC](https://www.ruby-forum.com/t/rails-and-perl-performance/71036/3 "2006-10-05T06:59:47Z")

</div>

Jessica F. wrote:

> First off, I’m not trying to ignite a language/tool war here.
> 
> mod\_perl configured correctly really can push out the pages.  
> Apache + Mongrel (Cluster) configured correctly can push out the pages,  
> but not to the extent of mod\_perl.
> 
> It it foreseable that we will see the same performance out of Apache and  
> Mongrel as mod\_perl? Is LiteSpeed’s LSAPI server any faster than Apache
> 
> - Mongrel?

The Ruby interpreter is slower than Perl. That will not change until,  
perhaps, Ruby 2.0. It isn’t a mod\_perl vs. mongrel thing.

-matthew

---

<div class="post-metadata">

**Author:** ![Jessica\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@Jessica\_F](https://www.ruby-forum.com/u/Jessica_F)\
**Post date:** [October 5, 2006, 8:48am UTC](https://www.ruby-forum.com/t/rails-and-perl-performance/71036/4 "2006-10-05T08:48:04Z")

</div>

On Wed, 4 Oct 2006 13:33:52 -0700  
snacktime [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Mongrel as mod\_perl? Is LiteSpeed’s LSAPI server any faster than Apache  
> > connections. And you have to put all these pieces together yourself  
> > and know a lot more about how everything works then you do with rails.

I think another way to say what snacktime is talking about is to simply  
point out that Rails is a FULL STACK system whereas mod\_perl is just a  
way to run perl. The equality is probably more of:

1. mongrel by itself vs. apache+mod\_perl
2. rails+mongrel vs. mod\_perl+mason+(whatever perl uses for AR, simply  
restful, etc.)

With the mongrel against mod\_perl you’d create the simplest action for  
each and then test them out with a tool like httperf. This would be  
your baseline performance. For Mongrel it’d be something simple like:

class TestHandler \< Mongrel::HttpHandler  
def process(req, resp)  
resp.start {|h,b| b.write(“test”) }  
end  
end

Fill that out with a bit of Configurator (see examples/simpletest.rb)  
and you’ll have your comparable test action. Then run both under the  
exact same conditions as in same server, same apache as a front end, no  
rewrite rules, etc. Try going against just mongrel see if that’s faster  
(sometimes it actually is when compared with older apache mod\_proxy).

The point is to be more exact in your comparisons so you avoid shoddy  
analysis. You may find that mod\_perl rocks Mongrel to the core, but  
once you pile on that full stack the performance is horrible compared to  
Rails. Java is definitely in this camp where a simple bare bones  
Servlet can be way faster that Mongrel, but once you let a Software  
Architect Level 10 Grade A build your Acegi+Hibernate+Spring\*+JTA+EJB  
monstrosity you get miserable performance.

–  
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu

> **[Zed A. shaw](https://zedshaw.com/)**
>
> Personal essays and writings by Zed A. Shaw.

[http://mongrel.rubyforge.org/](http://mongrel.rubyforge.org/)  
[http://www.lingr.com/room/3yXhqKbfPy8](http://www.lingr.com/room/3yXhqKbfPy8) – Come get help.

---

<div class="post-metadata">

**Author:** ![Jessica\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@Jessica\_F](https://www.ruby-forum.com/u/Jessica_F)\
**Post date:** [October 5, 2006, 3:10pm UTC](https://www.ruby-forum.com/t/rails-and-perl-performance/71036/5 "2006-10-05T15:10:28Z")

</div>

Zed A. Shaw wrote:

> The point is to be more exact in your comparisons so you avoid shoddy  
> analysis. You may find that mod\_perl rocks Mongrel to the core, but  
> once you pile on that full stack the performance is horrible compared to

Great information. Thanks Zed.
