Re: [OT] Proxy Nice Failure

2000-04-24 Thread shane

> I'm getting too sleepy to finish this off, so tomorrow.  (I have to

I guess I lied.  Patch is at:
ftp://esdev.net/pub/mod_proxy/modproxybeta1.patch.gz

This adds the functionality that Josh was referring to.  I'm still
thinking of adding the "tagged as down" functionality... maybe
tomorrow.  If I do that I'll probably make it's "load balancing"
algorithm a bit more equitable.

Anyway, usage is just two new apache conf file options:
ProxyTimeout (some number)
ProxyAttempt (some number)

By default these are both set to zero.  The timeout will cause
mod_proxy to sleep() for how many number of seconds you specify for
ProxyTimeout after a unsuccessful request.  The ProxyAttempt specifies
how many times to try the servers.  Keep in mind this is a beta patch,
and I'll do some more work on this later.  I might even try to pick up
this orphaned program, and do some real work on it.  It looks like it
was designed well to begin with, but suffered from "patch bloat" with
no one to look after it later.

Thanks,
Shane.

(BTW: in ./apache_blah/src/modules execute: cat
whateverthefile.patch|patch -p0 )




Re: [OT] Proxy Nice Failure

2000-04-24 Thread shane

> > I've been working on the mod_proxy code today, and it appears to me
> > that it already has this functionality.  It has an apache array
> > (really a null terminated link list I'm pretty sure) of proxies it can
> > access.  You just have to make multiple ProxyPassReverse declarations
> > and it will go through that list.  The only thing is it *should*
> > traverse the list randomnly... right now it traverses it linearly I'm
> > pretty sure.  Anyhow I'm adding that stuff Josh asked for.
> 
> Yes, I knew it had some way of spreading load, but I don't think
> it has any way to detect dead hosts.

Ah... yes you're right about that.  It will keep trying them.

> 
> > The link to the guide that explains how to use this features is:
> > www.apache.org/docs/misc/rewriteguide.html
> 
> Thanks - I've seen this but never quite followed the details of
> rewritemap all the way through.  The balance set configuration
> of mod_jserve seems easier, but it still needs to mesh with
> mod_rewrite anyway so that might not be worth changing.
> 
> > If I misconstrued what your asking for (likely) could you explain
> > further what mod_proxy doesn't have that you need?  Maybe I'll
> > implement it after I do the other stuff.
> 
> The missing piece is that if a host fails (at least if the
> connection is not accepted) and you have defined alternates
> it should mark the failing host dead and retry the request
> on one of the others.  Mod_jserv has a timed task that checks
> for hosts coming back up and a user interface to display status
> and manually mark hosts down.  This becomes slightly complicated
> by the fact that all of the httpd children need access to the
> status, but maybe you can re-use the jserv code.  I think it
> should work to just have a configurable timeout on the proxy connect
> before you consider a host down and a configurable time before
> it will try that one again (unless they are all dead...) so
> you wouldn't need the scheduled task to check status.

Yes, that makes sense.  Maybe I'll add it.  I'm doing a little work on
that section right now, and I'll think about it.  The problem is the
configuration isn't really conducive to this at the moment.  In fact
it's got two little funny ways of asking for proxy connections.  The
module needs to be re-written... well, a lot of it anyhow.  Redoing
the main handler function is really where a lot of this functionality
could be added.  The code that is underneath is really a bear..., but it
"works right", and theres no need to change it for the stuff we want
to add, so I'm a little reluctant to tear it apart just yet.  Anyhow,
I'm getting too sleepy to finish this off, so tomorrow.  (I have to
admit that this functionality your speaking of is probably the coolest
thing about the JServ engine..., with a little tweaking mod_proxy
could give us that..., but a lot of it's sort of patched up if you
know what I mean at the moment)

Thanks,
Shane.

> 
>   Les Mikesell
>[EMAIL PROTECTED]



Re: [OT] Proxy Nice Failure

2000-04-22 Thread Leslie Mikesell

According to Jim Winstead:
> On Apr 21, Michael hall wrote:
> > I'm on the new-httpd list (as a lurker, not a developer :-). Any ideas,
> > patches, help porting, etc. would be more than welcome on the list.
> > Mod-Proxy is actually kind of in limbo, there are some in favor of
> > dropping it and others who want it. I guess the code is difficult and
> > not easy to maintain and thats why some would just as soon see it go
> > unless someone steps up to maintain (redesign) it. There are some
> > working on it and apparently it will survive in some form or another.
> > Now would be a perfect time for anybody to get involved in it.
> 
> mod_backhand may also be the solution people are after.
> 
> http://www.backhand.org/

Is anyone using this in production?  It has the disadvantage
of requiring itself to be compiled into both the front and
back ends.  I have some backend data being generated by
custom programs running on NT boxes and would like to have
a fail-over mechanism.  We may end up running Windows load
balancing on them, but that means paying for Advanced Server
(about $3k extra) on each of them when a smart proxy would
work just as well. 

I also didn't see how to access it through mod_rewrite which
is how I control most of my proxy access.  This might be
possible by letting backhand handle certain directories and
RewriteRules to map to those directories - I just didn't get
that far yet.

> (Sorry for the off-topic-ness.)
> 
> I'm also coming around to the idea that caching proxies have some
> very interesting applications in a web-publishing framework outside
> of caching whole pages. All sorts of areas to exploit mod_perl in
> that sort of framework.

This can help with the load on a backend, but after watching squid
logs for a while I decided that a lot of extra traffic is passed
through when users hit the 'refresh' button which will send the
'Pragma: no-cache' header with the request.  For things like
images you may be better off using RewriteRules on the front
end to short-circuit the request, and other popular pages that
should update only at certain intervals can be done with
cron jobs and delivered from the front end as well.   So, from
a mod_perl perspective I don't care much about the caching side
but really need the relationship between mod_rewrite and
mod_proxy.  I haven't found equivalent built-in functionality in any
other server.

  Les Mikesell
[EMAIL PROTECTED]



Re: [OT] Proxy Nice Failure

2000-04-21 Thread Jim Winstead

On Apr 21, Michael hall wrote:
> I'm on the new-httpd list (as a lurker, not a developer :-). Any ideas,
> patches, help porting, etc. would be more than welcome on the list.
> Mod-Proxy is actually kind of in limbo, there are some in favor of
> dropping it and others who want it. I guess the code is difficult and
> not easy to maintain and thats why some would just as soon see it go
> unless someone steps up to maintain (redesign) it. There are some
> working on it and apparently it will survive in some form or another.
> Now would be a perfect time for anybody to get involved in it.

mod_backhand may also be the solution people are after.

http://www.backhand.org/

(Sorry for the off-topic-ness.)

I'm also coming around to the idea that caching proxies have some
very interesting applications in a web-publishing framework outside
of caching whole pages. All sorts of areas to exploit mod_perl in
that sort of framework.

Jim



Re: [OT] Proxy Nice Failure

2000-04-21 Thread Michael hall

On Sat, Apr 22, 2000 at 12:28:41AM +0300, Stas Bekman wrote:

> > > I like the mod_proxy module in reverse httpd accel mode, but 
> > > am interested in having some nicer failure capabilities.  I have 
> > > hacked in this kind of stuff before but was wondering if anyone 
> > > had any official patch for this kind of stuff.  



> Hmm, cool ideas folks. The problem is that you probably should ask for
> this at the mod_proxy list if such a beast exists. Unless the authors of
> the module are lurking around mod_perl list. Correct me if I'm wrong, I
> like the idea and I like it to be implemented too :)

I'm on the new-httpd list (as a lurker, not a developer :-). Any ideas,
patches, help porting, etc. would be more than welcome on the list.
Mod-Proxy is actually kind of in limbo, there are some in favor of
dropping it and others who want it. I guess the code is difficult and
not easy to maintain and thats why some would just as soon see it go
unless someone steps up to maintain (redesign) it. There are some
working on it and apparently it will survive in some form or another.
Now would be a perfect time for anybody to get involved in it.

--
Friends don't let friends use Windows.

Mike Hall,
Unix Admin   - Rock Island Communications   <[EMAIL PROTECTED]>
System Admin - riverside.org<[EMAIL PROTECTED]>



Re: [OT] Proxy Nice Failure

2000-04-21 Thread Stas Bekman

On Fri, 21 Apr 2000, Leslie Mikesell wrote:

> According to Joshua Chamas:
> 
> > I like the mod_proxy module in reverse httpd accel mode, but 
> > am interested in having some nicer failure capabilities.  I have 
> > hacked in this kind of stuff before but was wondering if anyone 
> > had any official patch for this kind of stuff.  
> > 
> > The nicety under consideration is having the mod_proxy module do 
> > X retries every Y seconds instead of failing immediately.  This 
> > would allow a backend Apache httpd do a stop/start without any
> > downtime apparent to the client besides the connection breaks
> > from the stop.  Depending on how much preloading is done at the
> > parent httpd, a start could take 5-10 seconds, and during this
> > time it would be cool if the proxy could just queue up requests.
> > 
> > Anyone does this with some nice ProxyTimeout ProxyRetry config
> > options?  Thanks.
> 
> No, but I'd like to add to the wishlist that it should do
> load balancing and failover across multiple backends too.
> Mod_jserv appears to have a pretty good scheme of letting
> you describe the balanced sets and an interface to view
> and control the backend status.  The only problem is that
> it is restricted to the jserv protocol for the backends.

Hmm, cool ideas folks. The problem is that you probably should ask for
this at the mod_proxy list if such a beast exists. Unless the authors of
the module are lurking around mod_perl list. Correct me if I'm wrong, I
like the idea and I like it to be implemented too :)


__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--




Re: [OT] Proxy Nice Failure

2000-04-21 Thread Leslie Mikesell

According to Joshua Chamas:

> I like the mod_proxy module in reverse httpd accel mode, but 
> am interested in having some nicer failure capabilities.  I have 
> hacked in this kind of stuff before but was wondering if anyone 
> had any official patch for this kind of stuff.  
> 
> The nicety under consideration is having the mod_proxy module do 
> X retries every Y seconds instead of failing immediately.  This 
> would allow a backend Apache httpd do a stop/start without any
> downtime apparent to the client besides the connection breaks
> from the stop.  Depending on how much preloading is done at the
> parent httpd, a start could take 5-10 seconds, and during this
> time it would be cool if the proxy could just queue up requests.
> 
> Anyone does this with some nice ProxyTimeout ProxyRetry config
> options?  Thanks.

No, but I'd like to add to the wishlist that it should do
load balancing and failover across multiple backends too.
Mod_jserv appears to have a pretty good scheme of letting
you describe the balanced sets and an interface to view
and control the backend status.  The only problem is that
it is restricted to the jserv protocol for the backends.

  Les Mikesell
[EMAIL PROTECTED]



[OT] Proxy Nice Failure

2000-04-21 Thread Joshua Chamas

Hey,

I like the mod_proxy module in reverse httpd accel mode, but 
am interested in having some nicer failure capabilities.  I have 
hacked in this kind of stuff before but was wondering if anyone 
had any official patch for this kind of stuff.  

The nicety under consideration is having the mod_proxy module do 
X retries every Y seconds instead of failing immediately.  This 
would allow a backend Apache httpd do a stop/start without any
downtime apparent to the client besides the connection breaks
from the stop.  Depending on how much preloading is done at the
parent httpd, a start could take 5-10 seconds, and during this
time it would be cool if the proxy could just queue up requests.

Anyone does this with some nice ProxyTimeout ProxyRetry config
options?  Thanks.

-- Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051