Forum: Ruby on Rails Lighty + Mongrel?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
429500a5a54600958c9c7ac032a37f66?d=identicon&s=25 Joe (Guest)
on 2006-03-07 04:22
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
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-03-07 05:51
(Received via mailing list)
Joe,

Try out http://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
http://www.zedshaw.com/


P.S.  This one goes out to technoweenie.  PFM == Pure Fucking Magic
Fcaf7a918c19872baf5c3b2787415e8e?d=identicon&s=25 Bradley Taylor (bktaylor)
on 2006-03-07 05:59
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:
http://lighttpd.net/documentation/cml.html
http://trac.lighttpd.net/trac/wiki/CacheMetaLanguage

Using CML with proxy to Mongrel and disable_web support:
http://mongrel.rubyforge.org/docs/lighttpd.html

The Lua programming language:
http://www.lua.org/

Good luck!

Bradley Taylor

-----
Rails Machine
Simplified web application deployment
http://railsmachine.com
429500a5a54600958c9c7ac032a37f66?d=identicon&s=25 Joe (Guest)
on 2006-03-07 07:12
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
429500a5a54600958c9c7ac032a37f66?d=identicon&s=25 Joe (Guest)
on 2006-03-07 12:22
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
This topic is locked and can not be replied to.