Hi everyone, Recently, I''ve been reading about different deployment environments for rails and mongrel. One configuration I''ve started seeing is apache -> pen -> mongrel cluster. See http://errtheblog.com/post/35 as an example. Can someone explain to me the benefit of using Apache and Pen as opposed to either using apache as a load balancer or pen by itself? Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061113/c1b15a59/attachment.html
Mark, In my case, I did that because I don''t have Apache 2.2 installed, but I wanted to use Apache for vhosting. So, I use the mod_proxy built into Apache to route among my various apps and static sites on the machine, and in the case of an app with mongrel_cluster I front it with Pen and route the requests to Pen and on to mongrel_cluster. Pen is just so easy to use... I was using Pound previously, but I haven''t been very impressed with Pound''s configuration options. And when it goes wrong it''s hard to tell why. In the future I might chuck Pen in favor of _balancer, but I''ve been avoiding dealing with installing Apache2.2 from Debian Experimental or compiling from source. So far the setup seems to work fine, but it would be nice to have the extra layer out of there just for ease of management. Once Lighty goes 1.5 I might go back to that, as well. Matt On 11/14/06, Mark Uhrmacher <mmmaui at gmail.com> wrote:> > Hi everyone, > > Recently, I''ve been reading about different deployment environments for > rails and mongrel. One configuration I''ve started seeing is apache -> pen > -> mongrel cluster. See http://errtheblog.com/post/35 as an example. > > Can someone explain to me the benefit of using Apache and Pen as opposed > to either using apache as a load balancer or pen by itself? > > Thanks, > > Mark > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > >-- Thermal Creative http://blog.thermalcreative.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/1681a92c/attachment.html
On 11/13/06, Mark Uhrmacher <mmmaui at gmail.com> wrote:> Can someone explain to me the benefit of using Apache and Pen as opposed to > either using apache as a load balancer or pen by itself?I''m on the Apache 2.0 + Pen + Mongrel bandwagon, mainly because Debian Sarge doesn''t have Apache 2.2 yet, and I seriously don''t feel like trying to manage a mess of hand-compiled applications across a server cluster. Instead, I watch the Debian Security RSS feed and run a Capistrano task if I see anything I recognize. The main benefit for running a proper web server like Apache up front is that you can configure it with mod_rewrite to serve up static files and only proxy dynamic requests. Mongrel is awesome, but Apache''s much better at serving static files. Also, Apache has mod_security, well-developed SSL capabilities, and there''s a wealth of information available on configuration and management. I''d love to use Lighty, but until it gets better proxying and rewrite modules (I heart disable_web), I''m sticking with Apache. Pound and Pen are very similar, and the main difference in when to use them is on what side of the web server they go on. Pound works best in front of web servers, mainly because you cannot disable the X_FORWARDED_FOR header. If you use it behind Apache, then Rails all requests to be requests from localhost, and so on an unhandled exception Rails farts out a full debug message to all and sundry. Pen, by default, doesn''t add this header (optionally it can), and so it makes for a wonderful intermediary between Apache and your Mongrel cluster. I had to switch from Pound to Pen because of the local request problem, and Pen''s handled all of the load testing just fine. It even allows you to specify a maximum concurrent connection limit for each server, so you don''t get a bunch of requests queued up in Mongrel and mess your load balancing up. The one down side to Pen is that the version in Debian stable doesn''t read from any kind of config file, nor does it come with a service script. So I had to write my own. You can get it at http://blog.codahale.com/2006/11/07/pound-vs-pen-because-you-need-a-load-balancing-proxy/ Right now Apache 2.0 + Pen + Mongrel is working like a charm, and I would only consider switching for four reasons: 1. Mongrel becomes stupid-fast with static files. 2. Apache 2.2 makes it into Debian Unstable. 3. Lighty''s proxy and rewrite module stop sucking and it makes it into Debian Unstable. 4. I get a hardware load balancer and a couple of Lighty-based asset hosts. Until then, I''m doin'' fine. -- Coda Hale http://www.wesabe.com http://blog.wesabe.com http://blog.codahale.com
On Tue, Nov 14, 2006 at 01:22:58PM +1300, Matt White wrote:> Mark, > > In my case, I did that because I don''t have Apache 2.2 installed, but I > wanted to use Apache for vhosting. So, I use the mod_proxy built into Apache > to route among my various apps and static sites on the machine, and in the > case of an app with mongrel_cluster I front it with Pen and route the > requests to Pen and on to mongrel_cluster. Pen is just so easy to use... Isame here, I use Debian stable, Apache 2.0 (because there''s no 2.2 in stable) and Pen as a mod_proxy_balancer replacement. works great, and I think I''ll keep it untill next stable comes out. If Apache 2.2 would be available in Debian Sarge, I''d use it''s mod_proxy_balancer instead, no question ;-) Jens -- webit! Gesellschaft f?r neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de Schnorrstra?e 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66
On Tue, Nov 14, 2006 at 01:22:58PM +1300, Matt White wrote:> In the future I might chuck Pen in favor of _balancer, but I''ve been > avoiding dealing with installing Apache2.2 from Debian Experimental or > compiling from source.Apache 2.2 is in Debian etch now. I''m running etch with apache2.2 on one machine with _balancer and mongrel and it works well for two rails-apps. -- sven
> > Recently, I''ve been reading about different deployment environments for > rails and mongrel. One configuration I''ve started seeing is apache -> pen > -> mongrel cluster. See http://errtheblog.com/post/35 as an example. > > Can someone explain to me the benefit of using Apache and Pen as opposed > to either using apache as a load balancer or pen by itself? >I have production environments with both apache2->pen->mongrel and apache2.2w/proxy_balancer->mongrel. I prefer the latter, for two reasons: 1) I like having fewer moving parts. That said, Pen has never, ever had a problem in my environment. 2) For the 2.2 w/mod_proxey_balancer setup, I''m using Charles Quinn''s customized deploy.rb to manage vhost setup and app deployment. I highly recommend it: http://svn.highgroove.com:8080/deployment/trunk/apache2_2_mongrel_deploy.rb. You can setup a new vhost and Rails app with a single command. Also, the server layout it utilizes (where it puts your apps, the vhost configs, etc) just makes sense. Andre -- andre.lewis at gmail.com My tech blog: http://earthcode.com WiFi cafes: http://hotspotr.com/wifi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061114/3a52ece0/attachment.html