On httpd I use ProxyPass and ProxyPassReverse to forward requests to webrick and mongrel. How can I do this same thing using Lighty and Mongrel? Thanks, Joe -- Posted via ruby-forum.com.
Joe, Try out mongrel.rubyforge.org/docs/lighttpd.html for the start of my docs in this direction. Some advanced PFM at the end you might not need. Zed A. Shaw zedshaw.com P.S. This one goes out to technoweenie. PFM == Pure Fucking Magic On 3/6/06 10:22 PM, "Joe" <joe@yahoo.com> wrote:> On httpd I use ProxyPass and ProxyPassReverse to forward requests to > webrick and mongrel. How can I do this same thing using Lighty and > Mongrel? > > Thanks, > Joe
Joe wrote:> On httpd I use ProxyPass and ProxyPassReverse to forward requests to > webrick and mongrel. How can I do this same thing using Lighty and > Mongrel? >Hey Joe, Lighty has a really cool feature called Cache Meta Language that lets you write write a script that is executed on every request called a "power magnet". Scripts are written in a light-weight language called Lua. With a power magnet you can check for the existence of a static file and return a "cache hit" if it exists. If it doesn''t exist, return a "cache miss" and the request will be forwarded as normal. In addition to mod_proxy, it may be possible to use this with mod_fcgi as an alternative to the check-local/error-handler-404 trick, but I''m not sure you would gain anything beyond having a standard way to handle static files. The power magnet is also handy for supporting Capistrano''s disable_web task. Lighty docs on CML: lighttpd.net/documentation/cml.html trac.lighttpd.net/trac/wiki/CacheMetaLanguage Using CML with proxy to Mongrel and disable_web support: mongrel.rubyforge.org/docs/lighttpd.html The Lua programming language: lua.org Good luck! Bradley Taylor ----- Rails Machine Simplified web application deployment railsmachine.com -- Posted via ruby-forum.com.
Wow, coolness :). I''ll have to check out the CML and PFM later. I added the proxy.balance and proxy.server lines to a couple of my hosts in lighty, fired up some mongrels, and everything seems to work fine and fast as shitola :). Joe -- Posted via ruby-forum.com.
Since switching to the multiple proxies and mongrels per host, I now have about 20 postgres connections per each host that are persisting. Is there a way to limit the number of connections? And/or make them non-persistant? Oh, also, does changing the number of processor threads make much/any difference when used with Rails? (I read the bit in the docs about how Rails isn''t thread-safe and the dispatch call is blocked.) Thanks, Joe -- Posted via ruby-forum.com.