On Tue, Nov 23, 2010 at 10:01 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> André,
>
> On 11/23/2010 10:27 AM, André Warnier wrote:
> > With the configuration below and your explanations, I suppose that there
> > is some kind of load-balancing going on between the two machines.
> > What is used at the front-end to load-balance ?
> >
> > An idea (for the moment vague) would be to use some intelligent
> > front-end, which would decide (maybe as Mark wrote, in function of the
> > client IP address) to start chanelling one client to either machine 1 or
> > machine 2 - and within it to Tomcat A,B,C or D - , set a cookie, and use
> > this cookie later to keep sending the same client to the same back-end
> > machine.
> > Kind of a session on top of a session..
>
> I believe there was a presentation at ApacheCon where someone presented
> something like this. I didn't attend, but I heard that a relatively
> simply use of httpd's mod_headers was used to essentially synthesize
> sticky sessions.
>
> The same technique could be applied to do a sort of "server stickiness":
>
> 1. Check the request for a SERVER_AFFINITY cookie
> 2. If none exists, choose a server however you like and set
>   SERVER_AFFINITY=A/B or D/C
> 3. Given a server affinity, send the request to a specific back-end
>   server.
>
> Note that #3 can be achieved by simply choosing an AJP worker that is
> not a load-balancer.
>
>
I guess you mean that:

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
env=BALANCER_ROUTE_CHANGED
<Proxy balancer://mycluster>
BalancerMember http://192.168.1.50:80 route=1
BalancerMember http://192.168.1.51:80 route=2
ProxySet stickysession=ROUTEID
</Proxy>
ProxyPass /test balancer://mycluster

>From http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html.

Thats working quite good even for not "Apache" backends like IIS. (To make
basic client affinity possible)

Maybe this could be used to stick the whole "Client" to one backend by the
first request?
If there is an entry context to set this cookie, it should be possible to
stick the client to the backend for the following contexts - maybe.

Mario



-- 
http://www.n0r1sk.com

Reply via email to