On 1 April 2012 11:15, ion ion <[email protected]> wrote:
> Recently I started using great tool for load balancing - Haproxy.
>
> There is only one disturbing thing that I cannot figure out how to deal with
> it. We use haproxy for load balancing mysql traffic. When there is a lot of
> traffic and many connection it takes ages for haproxy to reload (~ 30 min),
> with less traffic it does reload within 1 min.

What do you actually see that makes you think it takes ~30 minutes to reload?

> I do reload with:
>
> service haproxy reload
>
> Of course if I need to do an urgent change in configuration I expect haproxy
> to do reload very fast. Killing haproxy instances waiting for disconnection
> causes to disconnection of msyql connections.
>
> It looks like that I made mistake in settings of haproxy or in settings of
> application. If you know how to solve this please help me.

Your problem is possibly related to

a) your MySQL clients holding connections open
b) HAProxy not killing connections on reloads and
c) old HAProxy processes hanging around after reloads to deal with
existing connections.

I went through the same discovery when load-balancing MSSQL connections.

Whilst you /can/ get HAProxy to kill connections after a certain
timeout, it's not a good solution unless your clients have robust
error handling. You more likely need your MySQL clients to implement a
connection timeout themselves, so that they control the process.

Jonathan
-- 
Jonathan Matthews
London, Oxford, UK
http://www.jpluscplusm.com/contact.html

Reply via email to