Chris Richards
2006-Apr-20 13:00 UTC
[Rails] Can someone please explain Lighttpd + Mongrel + Rails.
I know that Mongrel is a web server that hosts rails applications. But i don''t understand what part Lighttpd (or Apache) has in the setup. I know that you can use Mongrel on its own. What does Lighttpd improve on? Thanks, Chris -- Posted via http://www.ruby-forum.com/.
Alan Francis
2006-Apr-20 14:19 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
Chris Richards wrote:> I know that Mongrel is a web server that hosts rails applications. But > i don''t understand what part Lighttpd (or Apache) has in the setup. I > know that you can use Mongrel on its own. What does Lighttpd improve > on?Some folks might use Lighttpd as an asset server. This would serve any static content (Light is FAST for that). Mongrel would be used as the app server, running the rails app to serve any dynamic content. A bit like putting tomcat instance behind Apache. Apache would serve the static stuff quickly, but delegate to tomcat as an appserver. With the rails model, I *think* you can either do it tat way, or the other way round. Instead of the static at the front, delegating back, the dynamic server is at the front, delegating static serves to the asset server (which is, IIRC a config parameter somewhere). Alternatively, I could be talking total nonsense. Alan -- Posted via http://www.ruby-forum.com/.
Xavier Noria
2006-Apr-20 14:28 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
On Apr 20, 2006, at 16:19, Alan Francis wrote:> A bit like putting tomcat instance behind Apache. Apache would serve > the static stuff quickly, but delegate to tomcat as an appserver. > With > the rails model, I *think* you can either do it tat way, or the other > way round. Instead of the static at the front, delegating back, the > dynamic server is at the front, delegating static serves to the asset > server (which is, IIRC a config parameter somewhere).Interesting, could anyone explain how to do this?> Alternatively, I could be talking total nonsense.Haaahaha -- fxn
Brian Hogan
2006-Apr-20 14:30 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
Lighttpd + Mongrel instructions are available on Mongrel''s main page. I''m working up Apache instructions for Windows users at the moment. On 4/20/06, Xavier Noria <fxn@hashref.com> wrote:> > On Apr 20, 2006, at 16:19, Alan Francis wrote: > > > A bit like putting tomcat instance behind Apache. Apache would serve > > the static stuff quickly, but delegate to tomcat as an appserver. > > With > > the rails model, I *think* you can either do it tat way, or the other > > way round. Instead of the static at the front, delegating back, the > > dynamic server is at the front, delegating static serves to the asset > > server (which is, IIRC a config parameter somewhere). > > Interesting, could anyone explain how to do this? > > > Alternatively, I could be talking total nonsense. > > Haaahaha > > -- fxn > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/da2fe3eb/attachment.html
Paul Wright
2006-Apr-20 14:39 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
On 20/04/06, Alan Francis <alancfrancis@gmail.com> wrote:> Chris Richards wrote: > > I know that Mongrel is a web server that hosts rails applications. But > > i don''t understand what part Lighttpd (or Apache) has in the setup. I > > know that you can use Mongrel on its own. What does Lighttpd improve > > on? > > Some folks might use Lighttpd as an asset server. This would serve any > static content (Light is FAST for that). Mongrel would be used as the > app server, running the rails app to serve any dynamic content.The other main benefit of sitting Mongrel behind Lighttpd is that you can then run multiple instances of Mongrel serving up the same app and configure Lighttpd to load balance between them. It looks like Apache 2.2 has support for doing the same thing that I''ll be looking into in the future. http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html Paul.
Alan Francis
2006-Apr-20 14:40 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
Xavier Noria wrote:> On Apr 20, 2006, at 16:19, Alan Francis wrote: > >> A bit like putting tomcat instance behind Apache. Apache would serve >> the static stuff quickly, but delegate to tomcat as an appserver. >> With >> the rails model, I *think* you can either do it tat way, or the other >> way round. Instead of the static at the front, delegating back, the >> dynamic server is at the front, delegating static serves to the asset >> server (which is, IIRC a config parameter somewhere). > > Interesting, could anyone explain how to do this? > >> Alternatively, I could be talking total nonsense. > > Haaahaha > > -- fxnPhew! not nonsense. See config/environments/production.rb # Enable serving of images, stylesheets, and javascripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" Alan -- Posted via http://www.ruby-forum.com/.
Chris Richards
2006-Apr-20 14:45 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
Thanks for the response. So what you''re saying is that Lighttpd or Apache are only good if there exists static content? Surely they have another purpose? I mainly write webb applications that have very little to no static content. Are you saying that Apache or Lighttpd are useless in that situation, Thanks, Chris -- Posted via http://www.ruby-forum.com/.
Xavier Noria
2006-Apr-20 14:49 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
On Apr 20, 2006, at 16:30, Brian Hogan wrote:> Lighttpd + Mongrel instructions are available on Mongrel''s main page.Sure, but the setup we were talking about puts Mongrel in front of lighttpd, not behind. -- fxn
Greg Freemyer
2006-Apr-20 15:00 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
Mongrel is not a full fledged webserver at this point. Assuming it follows the Tomcat tradition, it probably never will be. It is designed as a rails deployment webserver, not a Apache/Lighty replacement. If you need features it does not have, you need to front-end it. AIUI, it does not currently do: load-balancing, ssl, web-single login plugins(nor most other standard plug-ins), server static content at high-speed, etc. So, come up with a feature list of what you need for a webserver to do. Then ask if Mongrel can do them all. If not, you need to pick a front-end, or even avoid Mongrel altogether. Greg On 4/20/06, Chris Richards <evilgeenius@gmail.com> wrote:> Thanks for the response. > > So what you''re saying is that Lighttpd or Apache are only good if there > exists static content? Surely they have another purpose? I mainly write > webb applications that have very little to no static content. Are you > saying that Apache or Lighttpd are useless in that situation, > > Thanks, > Chris > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Greg Freemyer The Norcross Group Forensics for the 21st Century
Jean-François
2006-Apr-20 15:01 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
2006/4/20, Xavier Noria <fxn@hashref.com>:> On Apr 20, 2006, at 16:30, Brian Hogan wrote: > > > Lighttpd + Mongrel instructions are available on Mongrel''s main page. > > Sure, but the setup we were talking about puts Mongrel in front of > lighttpd, not behind.in front of/behind... well it''s just a matter of point of view, depending if you''re in server side or client side :-) -- Jean-Fran?ois. -- ? la renverse.
Marston Alfred
2006-Apr-20 15:08 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
Hrm, So is Mongrel an alternative to FastCGI? If so how do they compare in speed and resource usage to each other? On Apr 20, 2006, at 4:39 PM, Paul Wright wrote:> On 20/04/06, Alan Francis <alancfrancis@gmail.com> wrote: >> Chris Richards wrote: >>> I know that Mongrel is a web server that hosts rails >>> applications. But >>> i don''t understand what part Lighttpd (or Apache) has in the >>> setup. I >>> know that you can use Mongrel on its own. What does Lighttpd >>> improve >>> on? >> >> Some folks might use Lighttpd as an asset server. This would >> serve any >> static content (Light is FAST for that). Mongrel would be used as >> the >> app server, running the rails app to serve any dynamic content. > > The other main benefit of sitting Mongrel behind Lighttpd is that you > can then run multiple instances of Mongrel serving up the same app and > configure Lighttpd to load balance between them. It looks like Apache > 2.2 has support for doing the same thing that I''ll be looking into in > the future. > > http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html > > Paul. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Chris Richards
2006-Apr-20 15:17 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
If all application requests are forwarded to Mongrel then how does load-balancing functionality of Lighttpd affect anything? is it only for load balancing static content? Chris -- Posted via http://www.ruby-forum.com/.
Brian Hogan
2006-Apr-20 15:19 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
I really like Mongrel because it''s a lot easier to manage. Performance seems to be better than FastCGI in my tests, but I encourage you to do your own because every situation is different. Mongrel is the best alternative if you''re running on Windows like myself. On 4/20/06, Marston Alfred <marston@marstononline.com> wrote:> > Hrm, > > So is Mongrel an alternative to FastCGI? If so how do they compare > in speed and resource usage to each other? > > On Apr 20, 2006, at 4:39 PM, Paul Wright wrote: > > > On 20/04/06, Alan Francis <alancfrancis@gmail.com> wrote: > >> Chris Richards wrote: > >>> I know that Mongrel is a web server that hosts rails > >>> applications. But > >>> i don''t understand what part Lighttpd (or Apache) has in the > >>> setup. I > >>> know that you can use Mongrel on its own. What does Lighttpd > >>> improve > >>> on? > >> > >> Some folks might use Lighttpd as an asset server. This would > >> serve any > >> static content (Light is FAST for that). Mongrel would be used as > >> the > >> app server, running the rails app to serve any dynamic content. > > > > The other main benefit of sitting Mongrel behind Lighttpd is that you > > can then run multiple instances of Mongrel serving up the same app and > > configure Lighttpd to load balance between them. It looks like Apache > > 2.2 has support for doing the same thing that I''ll be looking into in > > the future. > > > > http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html > > > > Paul. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/50918a97/attachment.html
Tom Mornini
2006-Apr-20 16:46 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
On Apr 20, 2006, at 8:16 AM, Chris Richards wrote:> If all application requests are forwarded to Mongrel then how does > load-balancing functionality of Lighttpd affect anything? is it only > for load balancing static content?Lighttpd is configured to send app requests to several Mongrels. -- -- Tom Mornini
Matt White
2006-Apr-20 16:55 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
So what are the scaling implications of using Lighty to proxy to Mongrel vs. Lighty pointing to FastCGI processes? I''m working on an app that I expect to scale to at least a couple of app servers, and I''ve just been planning on using lighty as a load-balancer between several FastCGI processes running on each app server. Is Mongrel a faster/more stable/lighter alternative to this? I''ve seen some of the Mongrel performance tests, and it didn''t seem to be much of a step up in performance. But, I haven''t done a very in-depth study of it yet (still in design/development mode), so I could easily, and probably am, incorrect. Thanks! Matt On 4/20/06, Tom Mornini <tmornini@infomania.com> wrote:> > On Apr 20, 2006, at 8:16 AM, Chris Richards wrote: > > > If all application requests are forwarded to Mongrel then how does > > load-balancing functionality of Lighttpd affect anything? is it only > > for load balancing static content? > > Lighttpd is configured to send app requests to several Mongrels. > > -- > -- Tom Mornini > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/ce3d8dc6/attachment.html
Tom Mornini
2006-Apr-20 18:00 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
On Apr 20, 2006, at 9:54 AM, Matt White wrote:> So what are the scaling implications of using Lighty to proxy to > Mongrel vs. Lighty pointing to FastCGI processes? I''m working on an > app that I expect to scale to at least a couple of app servers, and > I''ve just been planning on using lighty as a load-balancer between > several FastCGI processes running on each app server.Good plan.> Is Mongrel a faster/more stable/lighter alternative to this?It''s easier to set up *because* it doesn''t require FCGI support.> I''ve seen some of the Mongrel performance tests, and it didn''t seem > to be much of a step up in performance.Depends on when it was tested, and what was being tested. :-) -- -- Tom Mornini
Matt White
2006-Apr-20 18:07 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
Tom, I''m no sysadmin (but I''m trying to be one anyway), so sorry for bugging you ;) Since Lighty has FastCGI support baked in, in what case would you use Mongrel instead of just using FCGI with Lighty? Would this primarily be of use if you were using another webserver like Apache that''s known to have problematic FCGI support? In the Apache case, I''m assuming that you would use Apache to proxy directly to Mongrel instead of using Lighty as an intermediary between the two... Is this correct? If so, I guess I''ll go ahead with my original plan. I''ve been watching Mongrel and wondering if it was an advantageous alternative to FCGI... Thanks! Matt On 4/20/06, Tom Mornini <tmornini@infomania.com> wrote:> > On Apr 20, 2006, at 9:54 AM, Matt White wrote: > > > So what are the scaling implications of using Lighty to proxy to > > Mongrel vs. Lighty pointing to FastCGI processes? I''m working on an > > app that I expect to scale to at least a couple of app servers, and > > I''ve just been planning on using lighty as a load-balancer between > > several FastCGI processes running on each app server. > > Good plan. > > > Is Mongrel a faster/more stable/lighter alternative to this? > > It''s easier to set up *because* it doesn''t require FCGI support. > > > I''ve seen some of the Mongrel performance tests, and it didn''t seem > > to be much of a step up in performance. > > Depends on when it was tested, and what was being tested. :-) > > -- > -- Tom Mornini > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/d28349f9/attachment.html
Matthew Beale
2006-Apr-20 18:15 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
Chris Richards wrote:> If all application requests are forwarded to Mongrel then how does > load-balancing functionality of Lighttpd affect anything? is it only > for load balancing static content?I think you''re a little confused Chris, load-balancing is when you spread multiple requests across multiple services that answer that request. Lighttpd load balances mongrel or fast-cgi requests buy spreading them evenly among several mongrel or fast-cgi servers. Because a single rails process can only process one request at a time, having multiple servers means you can answer multiple requests at the same time. Hence, a response time improvement when under a high load of requests. -- Matthew Beale :: mixonic@synitech.com Resume & Portflio @ http://madhatted.com -- Posted via http://www.ruby-forum.com/.
Zed Shaw
2006-Apr-20 18:27 UTC
[Rails] Can someone please explain Lighttpd + Mongrel + Rails.
On 4/20/06 9:00 AM, "Chris Richards" <evilgeenius@gmail.com> wrote:> I know that Mongrel is a web server that hosts rails applications. But > i don''t understand what part Lighttpd (or Apache) has in the setup. I > know that you can use Mongrel on its own. What does Lighttpd improve > on? >Mongrel does the Ruby dynamic requests well and can server static files pretty fast, so running smallish sites on just Mongrel is a good choice. But, if you have a large amount of content then your strategy has to be putting Mongrel behind some other webserver that is faster. This is the same strategy when doing Tomcat behind Apache. Apache does some caching and serves static files like images and such, and then proxies to Tomcat for anything dynamic. The interesting addition over Tomcat is that Ruby on Rails provides excellent page caching and fragment caching. This means that once your fronting webserver is configured correctly you can have Rails write the page rendering results to disk and then your web server will service future requests from static files. This kind of caching increases performance tremendously. In short, Lighttpd or Apache or Litespeed are used to do two things: 1) Serve any static content without talking to Mongrel (including cached pages). 2) Load balance to a group of Mongrel servers for better parallel response. Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
Zed Shaw
2006-Apr-20 18:29 UTC
[Rails] Re: Can someone please explain Lighttpd + Mongrel + Rails.
On 4/20/06 11:07 AM, "Marston Alfred" <marston@marstononline.com> wrote:> So is Mongrel an alternative to FastCGI? If so how do they compare > in speed and resource usage to each other? >So far our experience has been that Mongrel performs as well or better than FastCGI, is more stable (no memory leaks so far), and is easier to cluster and manage since it''s HTTP based. That being said, every application is different so you''ll want to test both if you have questions and choose the right solution for your needs. If you do choose FastCGI for some reason I''d love to hear your feedback. Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
Zed Shaw
2006-Apr-20 18:36 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
On 4/20/06 12:54 PM, "Matt White" <stockliasteroid@gmail.com> wrote:> So what are the scaling implications of using Lighty to proxy to Mongrel vs. > Lighty pointing to FastCGI processes? I''m working on an app that I expect to > scale to at least a couple of app servers, and I''ve just been planning on > using lighty as a load-balancer between several FastCGI processes running on > each app server. Is Mongrel a faster/more stable/lighter alternative to this? > I''ve seen some of the Mongrel performance tests, and it didn''t seem to be much > of a step up in performance. But, I haven''t done a very in-depth study of it > yet (still in design/development mode), so I could easily, and probably am, > incorrect. >First, there needs to be a distinction between "performance" and "scalability". Performance is how fast your current deployment can answer requests. Scalability is how you can increase that performance by adding resources. Not lecturing just clarifying so I can focus the discussion. For performance Mongrel performs as well as FastCGI in my applications, but you really need to do your own evaluation. I''d start with Mongrel since the setup is easier and then try FastCGI if you don''t get the speed you need. Also, use httperf to do your measurements. One advantage that Mongrel has over FastCGI is that it''s Handlers framework means you can move dynamic content which doesn''t use much of the Rails API into a Handler that is serviced directly with Mongrel. This gives you quite a few options for tuning your application where it''s needed. For scalability Mongrel wins since it''s just HTTP. If you try to find load balancing options for FastCGI you''re pretty much stuck with plain TCP balancers. For HTTP there''s a mountain of experience and tools related to scaling out to larger installations. This means you can start small with just a single box, a web server, and a few Mongrel servers, and then expand with various options later when you see the need. Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
Zed Shaw
2006-Apr-20 18:38 UTC
[Rails] Re: Re: Can someone please explain Lighttpd + Mongrel + Rail
On 4/20/06 2:07 PM, "Matt White" <stockliasteroid@gmail.com> wrote:> Since Lighty has FastCGI support baked in, in what case would you use Mongrel > instead of just using FCGI with Lighty? Would this primarily be of use if you > were using another webserver like Apache that''s known to have problematic FCGI > support? In the Apache case, I''m assuming that you would use Apache to proxy > directly to Mongrel instead of using Lighty as an intermediary between the > two... Is this correct? >If you''re married to lighttpd then there''s one caution related to Mongrel: the mod_proxy in lighttpd is broken. It has problems detecting that a backend is down. My more recent recommendation is for people to check out litespeed as an alternative: http://weblog.techno-weenie.net/2006/4/11/setting-up-litespeed-with-mongrel Or, to point lighttpd at *one* port which runs balance and then let balance talk to all of the Mongrel servers. This option also works well for Apache. http://www.inlab.de/balance.html Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/