httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Rectanus" <brect...@gmail.com>
Subject Re: svn commit: r417238 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_proxy_balancer.xml modules/proxy/mod_proxy_balancer.c
Date Mon, 26 Jun 2006 21:18:58 GMT
On 6/26/06, Mladen Turk <mturk@apache.org> wrote:
> Mladen Turk wrote:
> > rpluem@apache.org wrote:
> >> Author: rpluem
> >> Date: Mon Jun 26 09:59:38 2006
> >> New Revision: 417238
> >>
> >> +    apr_table_setn(r->subprocess_env,
> >> +                   "BALANCER_WORKER_ROUTE", (*worker)->s->route);
> >> +
> >
>
> Thinking of it more deeply, the only valuable env var would
> be BALANCER_SESSION_ROUTE.
> All other parms are meaningless for the client unless
> you wish to create a loadbalancer as a cgi script.
>
> Regards,
> Mladen.
>
>

I had two intentions with BALANCER_SESSION_ROUTE:

1) Provide a way for client to detect a server switch and possibly
cleanup (maybe remove the session cookie so next attempt would not
fail if server was gone and nofailover=On).  Cleanup will be important
since these are session cookies and the server app has no way to
cleanup (it is down) and the user must restart his/her browser (remove
session cookie) to rebalance.

RewriteRule "%{ENV:BALANCER_SESSION_ROUTE}
!="%{BALANCER_WORKER_ROUTE}" [E=REBALANCED:1]
Header add Set-Cookie "MYCOOKIE=;
path=/; expires=Monday, 01-Jan-1990 08:00:00 GMT

" env=REBALANCED

2) Provide a way to get the value of session route w/o parsing
URL/header for the parameter/cookie value.

RewriteRule "%{ENV:BALANCER_SESSION_ROUTE}
!="%{BALANCER_WORKER_ROUTE}" [E=REBALANCED:1]
Header set X-OldSession "%{ENV:BALANCER_SESSION_ROUTE}"

But, looking at 2 again, it will not work anyway since it is not added
to env until later in cycle.  I'll look at that more.


BALANCER_SESSION_STICKY was to allow the client to be able to pass the
cookie name on to the server dynamically or use the value to parse the
url/cookie header for the value.  It is also used as a note in
mod_proxy_balancer.c, so I thought since it was important enough for
that it might be useful in the environment as well ;)

SetEnvIf ^Cookie$ "${BALANCER_SESSION_STICKY}=([^ \.;]*)\.([^ ;]*)" MYROUTE=$1

But, as 2 above fails, so does this.


BALANCER_WORKER_NAME was intended to be used by output filters such as
mod_proxy_html, etc.  But, it also adds a unique identifier when no
route= parameter is used.  BALANCER_NAME is to make
BALANCER_WORKER_NAME unique if multiple balancers are used in a given
context.  So "%{BALANCER_NAME}e%{BALANCER_WORKER_NAME}" is a unique
identifier to where the request is routed when there is no route=
parameter used.


Thanks,
-B

Mime
View raw message