Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-10 Thread mod_perl

The idea to modify mod_proxy.c is probaly the most 
convenient solution. Instead of configure backend 
machine from the ProxyPass setting, you may specifically 
assign it to the one in the cookie, which takes only a 
few lines of code to change --- well, plus extra steps 
to handle the cookie. ProxyPass is processed at the URL 
translation phase. If the same cookie is used for other 
purposes such as access control then there is no cost at 
all. (sorry, this is in the c API, kind of OT.)


Peter Bi
 Hello,
 
 I'd like to know if it is possible to use mod_proxy as a sticky session
 manager.  Basically, I'd like to put mod_proxy behind the load balancer and
 allow the proxy servers to talk to the mod_perl servers.  Unfortunately, the
 load balancer does not allow for sticky sessions and only bounces the user
 round-robin style.  I am playing with the idea of sending a cookie down to
 the client and using it to stick a user to a particular mod_perl server, but
 I'd like mod_proxy to figure it out which server and send the user to the
 defined machine.  I'd also like to enable a checking mechanism to
 determine if a mod_perl server is up before the user is sent to the location
 specified in the cookie.  If the machine that the client is stuck to is
 down, I'd like to reroute.
 
 I know high powered load balancers do this already, but I'd like to explore
 dedicating a few medium sized servers to do as there is surplus of these and
 f5's cost $$$.  I apologize in advance if this is a bit off topic!
 
 Thanks,
 
 Al
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 
 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 
 www.mimesweeper.com
 **
 



Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-10 Thread Perrin Harkins

[EMAIL PROTECTED] wrote:
 The idea to modify mod_proxy.c is probaly the most 
 convenient solution. Instead of configure backend 
 machine from the ProxyPass setting, you may specifically 
 assign it to the one in the cookie, which takes only a 
 few lines of code to change --- well, plus extra steps 
 to handle the cookie.

But you're not accounting for the possibility of server failure on the 
backend.  A proper load-balancer (including the open source ones and 
mod_backhand) would detect dead servers and handle the failover to 
another server.  Building this yourself is probably not worth it, with 
so many open source solutions already available.

- Perrin




Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-10 Thread mod_perl

[EMAIL PROTECTED] wrote:
But you're not accounting for the possibility of server 
failure on the backend. A proper load-balancer
(including the open source ones and 
 mod_backhand) would detect dead servers and handle the 
failover to 
 another server. 
This is true. Then one has to ping the network which is 
very expensive. --- yes, a special product would be 
better.

 Building this yourself is probably not worth it, with 
 so many open source solutions already available.

The original post consists of two parts: to proxy to the 
right machine and to handle the failover. If there is a 
quick solution to the first part, why not make it and 
have the second part be solved later ? 

Peter Bi

 [EMAIL PROTECTED] wrote:
  The idea to modify mod_proxy.c is probaly the most 
  convenient solution. Instead of configure backend 
  machine from the ProxyPass setting, you may specifically 
  assign it to the one in the cookie, which takes only a 
  few lines of code to change --- well, plus extra steps 
  to handle the cookie.
 
 But you're not accounting for the possibility of server failure on the 
 backend.  A proper load-balancer (including the open source ones and 
 mod_backhand) would detect dead servers and handle the failover to 
 another server.  Building this yourself is probably not worth it, with 
 so many open source solutions already available.
 
 - Perrin
 



Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-06 Thread Paul Lindner

On Fri, Sep 06, 2002 at 08:44:39AM -0400, Calbazana, Al wrote:
 Hello,
 
 I'd like to know if it is possible to use mod_proxy as a sticky session
 manager.  Basically, I'd like to put mod_proxy behind the load balancer and
 allow the proxy servers to talk to the mod_perl servers.  Unfortunately, the
 load balancer does not allow for sticky sessions and only bounces the user
 round-robin style.  I am playing with the idea of sending a cookie down to
 the client and using it to stick a user to a particular mod_perl server, but
 I'd like mod_proxy to figure it out which server and send the user to the
 defined machine.  I'd also like to enable a checking mechanism to
 determine if a mod_perl server is up before the user is sent to the location
 specified in the cookie.  If the machine that the client is stuck to is
 down, I'd like to reroute.
 
 I know high powered load balancers do this already, but I'd like to explore
 dedicating a few medium sized servers to do as there is surplus of these and
 f5's cost $$$.  I apologize in advance if this is a bit off topic!

Two things come to mind.  First mod_rewrite has plenty of features that
will let you do primitive load balancing.  See

  http://httpd.apache.org/docs/misc/rewriteguide.html

Look at the examples that show how to combine a cookie with the URI and
you can use regexes to control which host is chosen.

Also check out mod_backhand (discussed on this list, check the archives)

  http://www.backhand.org/

-- 
Paul Lindner[EMAIL PROTECTED]   | | | | |  |  |  |   |   |

mod_perl Developer's Cookbook   http://www.modperlcookbook.org/
 Human Rights Declaration   http://www.unhchr.ch/udhr/



Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-06 Thread Perrin Harkins

Calbazana, Al wrote:
 I'd like to know if it is possible to use mod_proxy as a sticky session 
 manager.

It's possible in the sense that you could write a sticky session manager 
and glom it onto mod_proxy.  It's certainly not there right now.

If you just want a free load-balancer, take a look at one of the many 
open source projects out there like http://linux-ha.org/.

- Perrin




Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-06 Thread Perrin Harkins

Ask Bjoern Hansen wrote:
 On Fri, 6 Sep 2002, Perrin Harkins wrote:
 
 
Calbazana, Al wrote:

I'd like to know if it is possible to use mod_proxy as a sticky session
manager.

It's possible in the sense that you could write a sticky session manager
and glom it onto mod_proxy.  It's certainly not there right now.
 
 
 Uh, couldn't a combination of mod_backhand and mod_rewrite (using
 cookies) do it?

I believe mod_backhand could do it alone, but that's not mod_proxy. 
None of the approaches I've seen for using mod_rewite with mod_proxy for 
load-balancing handle the high-availability part, i.e. removing servers 
that have gone down from rotation, but mod_backahand does, and it 
handles sticky sessions.

- Perrin