Re: Multiple Load Balancers, stick table and url-embedded session support

2010-12-09 Thread Hank A. Paulson

Please see the thread:
need help figuring out a sticking method

I asked about this, Willie says there are issues figuring out a workable 
config syntax for 'regex to pull the URL/URI substring' but (I think) that 
coding the functionality is not technically super-difficult just not enough 
hands maybe and the config syntax?


I have a feeling this would be a fairly commonly used feature, so it is good 
to see others asking the same question  :)


How are you planning to distribute the traffic to the different haproxy 
instances? LVS? Some hardware?


On 12/8/10 8:58 PM, David wrote:

Hi there,

I have been asked to design an architecture for our load-balancing needs, and
it looks like haproxy can do almost everything needed in a fairly
straightfoward way. Two of the requirements are stickiness support (always
send a request for a given session to the same backend) as well as multiple
load balancers running at the same time to avoid single point of failure
(hotbackup with only one haproxy running at a time is not considered 
acceptable).

Using multiple HAproxy instances in parallel with stickiness support looks
relatively easy if cookies are allowed (through e.g. cookie prefixing) since
no information needs to be shared. Unfortunately, we also need to support
session id embedded in URL (e.g. http://example.com/foo?sess=someid), and I
was hoping that the new sticky table replication in 1.5 could help for that,
but I am not sure it is the case.

As far as I understand, I need to first define a table with string type, and
then use the store-request to store the necessary information. I cannot see a
way to get some information embedded in the URL using the existing query
extraction methods. Am I missing something, or is it difficult to do this with
haproxy ?

regards,

David





Re: Multiple Load Balancers, stick table and url-embedded session support

2010-12-09 Thread Jeffrey 'jf' Lim
On Thu, Dec 9, 2010 at 7:27 PM, Hank A. Paulson 
h...@spamproof.nospammail.net wrote:

 Please see the thread:
 need help figuring out a sticking method

 I asked about this, Willie says there are issues figuring out a workable
 config syntax for 'regex to pull the URL/URI substring' but (I think) that
 coding the functionality is not technically super-difficult just not enough
 hands maybe and the config syntax?


Actually if the key is to taken from a query param, that is relatively
easy enough (I coded something myself for a client some time back based on
1.3.15.4). If, however, more flexibility is required (like in your case),
then the point that Willie has mentioned will definitely come into play.

-jf


I have a feeling this would be a fairly commonly used feature, so it is good
 to see others asking the same question  :)

 How are you planning to distribute the traffic to the different haproxy
 instances? LVS? Some hardware?


 On 12/8/10 8:58 PM, David wrote:

 Hi there,

 I have been asked to design an architecture for our load-balancing needs,
 and
 it looks like haproxy can do almost everything needed in a fairly
 straightfoward way. Two of the requirements are stickiness support (always
 send a request for a given session to the same backend) as well as
 multiple
 load balancers running at the same time to avoid single point of failure
 (hotbackup with only one haproxy running at a time is not considered
 acceptable).

 Using multiple HAproxy instances in parallel with stickiness support looks
 relatively easy if cookies are allowed (through e.g. cookie prefixing)
 since
 no information needs to be shared. Unfortunately, we also need to support
 session id embedded in URL (e.g. http://example.com/foo?sess=someid), and
 I
 was hoping that the new sticky table replication in 1.5 could help for
 that,
 but I am not sure it is the case.

 As far as I understand, I need to first define a table with string type,
 and
 then use the store-request to store the necessary information. I cannot
 see a
 way to get some information embedded in the URL using the existing query
 extraction methods. Am I missing something, or is it difficult to do this
 with
 haproxy ?

 regards,

 David





Re: Multiple Load Balancers, stick table and url-embedded session support

2010-12-09 Thread David


On 12/09/2010 08:27 PM, Hank A. Paulson wrote:

Please see the thread:
need help figuring out a sticking method

I asked about this, Willie says there are issues figuring out a workable
config syntax for 'regex to pull the URL/URI substring' but (I think)
that coding the functionality is not technically super-difficult just
not enough hands maybe and the config syntax?

I have a feeling this would be a fairly commonly used feature, so it is
good to see others asking the same question :)


My use-case is pretty simple, since it was fullfilled without stick 
table using the appsession configuration parameter, e.g.


appsession MYSESSIONID len 64 timeout 1h request-learn mode query-string

IOW, I only need simple string matching, and that maybe be an acceptable 
first step ? How long do you think it would take ? I am relatively 
familiar with C, but have no knowledge of network programming nor I have 
ever looked into haproxy source code.



How are you planning to distribute the traffic to the different haproxy
instances? LVS? Some hardware?


I don't know exactly - I think using somekind of DNS round robin scheme 
between our set of load balancers (we have something similar a the 
moment with pound as load balancer, but without any kind of sticky 
session support). We are required not to use hardware.


cheers,

David



Re: Multiple Load Balancers, stick table and url-embedded session support

2010-12-09 Thread David

Hi Jeffrey,

On 12/09/2010 10:13 PM, Jeffrey 'jf' Lim wrote:

On Thu, Dec 9, 2010 at 7:27 PM, Hank A. Paulson
h...@spamproof.nospammail.net mailto:h...@spamproof.nospammail.net wrote:

Please see the thread:
need help figuring out a sticking method

I asked about this, Willie says there are issues figuring out a
workable config syntax for 'regex to pull the URL/URI substring' but
(I think) that coding the functionality is not technically
super-difficult just not enough hands maybe and the config syntax?


Actually if the key is to taken from a query param, that is relatively
easy enough (I coded something myself for a client some time back based
on 1.3.15.4).


Would that be something you could and would be willing to share ?

regards,

David