LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: KTCPVS phttp new cookie question

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: KTCPVS phttp new cookie question
From: Wensong Zhang <wensong@xxxxxxxxxxxx>
Date: Sun, 16 Mar 2003 20:32:38 +0800 (CST)

Hi,

On Thu, 13 Mar 2003 jpcl@xxxxxxxxxxxxxx wrote:

> I want to try KTCPVS as a load balancer with sticky session (cookie) support.
> Well, I was theoretically thinking on this and I don't see how this
> problem is solved:
> 
> I use LVS-DR. So packets go to Director, are forwarded to Realserver, and
> then go direct to outside router.
> If cookie management is at director level, and packets go in one-way only,
> then:
> 
>  1 - Client send request {req}. Request has no cookie attached.
>  2 - Director sees no cookie, forwards to RS1
>  3 - RS1 gives cookie COOKIE1
>  4 - Packet goes out with {COOKIE1, reply}
> 
>  5 - Client send new request {COOKIE1, newReq}
>  6 - Director sees COOKIE1, but has no mapping information of it ?!?
> 

You can use the persistence feature of LVS-DR to solve this cookie
problem. If the virtual service is specified as persistent, all the 
requests from a single client (per IP address) will be redirected to the 
same server selected for the first request.

> This doesn't seems to be a problem specific to KTCPVS, but to all
> arquitectures who do not use a "two-way" balancer.
> Maybe the solution is completely different, and the balancer itself
> inserts the control cookie?
> 
> You'ld have
>  1 -
>  2 - Director sees no cookie, forwards to RS1 as {DIR_COOKIE1, req}
>  3
>  4 - Packet goes out with {DIR_COOKIE1, COOKIE1, reply}
> ...
> 
>  Is this the racionale behind KTCPVS phttp behaviour?
> 

Yes, KTCPVS can remember the cookies and send requests according to the
cookies, but current KTCPVS code doesn't support. We are thinking about 
adding this support.

However, with content-based scheduling module, you may use the rule to 
assign some stateful requests to the same servers and stateless requests 
to other servers.

> Thank you
> Joao Clemente
> 

Regards,

Wensong

<Prev in Thread] Current Thread [Next in Thread>