On Wed, Apr 18, 2012 at 2:12 AM, Amit More <am...@xetus.com> wrote:
> Hello All,
>
> I have set up HAProxy (version 1.3.22 on Ubuntu Server 10.04 64-bit) with 
> "source" as the load balancing algorithm and it works fine. I was wondering 
> if  i could configure HAProxy to use "roundrobin" with client timeout. What i 
> mean is that the client should be timed out after some inactivity time and 
> the client's request after the timeout should be served by the next available 
> server. I have tried "roundrobin" with "timeout client 5m" but the client was 
> timed out before the 5m timer expired.
> If i have understood the "timeout client" directive of the haproxy.cfg file 
> correctly, then why is the client request routed to a different server before 
> the timer (timeout client) expires? If I've got that totally wrong, can 
> somebody please explain to me how to achieve stickiness with roundrobin (or 
> leastconn) algorithm?
> Appreciate your time and help.
>
> Thanks,
> Amit

Hi Amit,

If you want to do round-robin and stickyness, the best way is to use
coukies, either inserting one or learning an application cookie.
Some explanations and examples provided here:
http://blog.exceliance.fr/2012/03/29/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/

Concerning the timeout you want to achieve, you're misunderstanding
client and server timeouts.
You may want also to enable "retry" and "option redispatch" to tell
haproxy to forward the request to an other server if the one it was
trying to get connected is failaing at the moment of the request.
That way, the timeout connect will be used and if HAProxy can't be connected.

Regards

Reply via email to