# Fastcgi or mod\_ruby?

**URL:** <https://www.ruby-forum.com/t/fastcgi-or-mod-ruby/77804>\
**Category:** Ruby\
**Created:** [March 7, 2006, 2:30pm UTC](https://www.ruby-forum.com/t/fastcgi-or-mod-ruby/77804 "2006-03-07T14:30:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominik\_Werder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@Dominik\_Werder](https://www.ruby-forum.com/u/Dominik_Werder)\
**Post date:** [March 7, 2006, 2:30pm UTC](https://www.ruby-forum.com/t/fastcgi-or-mod-ruby/77804/1 "2006-03-07T14:30:30Z")

</div>

Hello!

Does anybody know whether mod\_ruby or fastcgi is the superior way of  
doing http based applications? I don’t need the eruby part of mod\_ruby,  
and at the moment I’m happy with fastcgi, but maybe it’s good to hear  
some opinions…

thanks!  
Dominik

---

<div class="post-metadata">

**Author:** ![Dominik\_Werder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@Dominik\_Werder](https://www.ruby-forum.com/u/Dominik_Werder)\
**Post date:** [March 7, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/fastcgi-or-mod-ruby/77804/2 "2006-03-07T18:59:40Z")

</div>

Dominik Werder wrote:

> Does anybody know whether mod\_ruby or fastcgi is the superior way of  
> doing http based applications? I don’t need the eruby part of mod\_ruby,  
> and at the moment I’m happy with fastcgi, but maybe it’s good to hear  
> some opinions…  
> Two comments and I am sure others will comment.

If your platform is at all efficient you can get along pretty good with  
neither. I am running Apache on a Mac OS X dual 2.5 Tiger 10.4.5 and I  
write all my CGI in Ruby. Never saw a slow down with using just pain  
cgi-bin.

Getting FastCGI working on Apache is a chore.

john

---

<div class="post-metadata">

**Author:** ![Dominik\_Werder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@Dominik\_Werder](https://www.ruby-forum.com/u/Dominik_Werder)\
**Post date:** [March 7, 2006, 8:40pm UTC](https://www.ruby-forum.com/t/fastcgi-or-mod-ruby/77804/3 "2006-03-07T20:40:15Z")

</div>

The two are fairly different: mod\_ruby gives you access to the full  
Apache API including access control and output filtering, while FastCGI  
(at least in the least-common-denominator form that Apache supports) is  
basically just a means of avoiding the process forking and  
initialization overhead of traditional CGI.

There are pros and cons to either solution. Because it gives you so  
much power over the entire HTTP request handling process, mod\_ruby can  
let you do things that are more difficult with CGI, like request URL  
rewriting. However, it ties you to Apache exclusively, while FastCGI  
handlers can be run behind any number of HTTP servers, including the  
increasingly-popular Lighttpd.

Personally, I’m moving towards using FastCGI behing Lighttpd for a  
number of applications, primarily due to its built-in load balancing.  
If you don’t need the kind of low-level power that mod\_ruby offers, I’d  
recommend staying with FastCGI for its simplicity and portability.

-rcoder
