Re: Question about TCP balancing

From: Dmitry Sivachenko <mitya#cavia.pp.ru>
Date: Tue, 4 Aug 2009 11:18:25 +0400


Hello!

Thanks for clarification.

I have another question then (trying to solve my problem in a different way).

I want to setup the following configuration. I have 2 sets of servers (backends): let call one set NEAR (n1, n2, n3) and another set FAR (f1, f2, f3).

I want to spread incoming requests between NEAR servers only when they are alive, and move load to FAR servers in case NEAR set is down.

Is it possible to setup such configuration?

I read the manual but did not find such a solution...

Thanks in advance!

On Mon, Aug 03, 2009 at 09:46:47PM +0200, Willy Tarreau wrote:
> No it's not, and it's not only a configuration issue, it's an OS
> limitation. The only way to achieve this is to stop listening to
> the port then listen again to re-enable the port. On some OSes, it
> is possible. On other ones, you have to rebind (and sometimes close
> then recreate a new socket). But once your process has dropped
> privileges, you can't always rebind if the port is <1024 for
> instance.
>
> So instead of having various behaviours for various OSes, it's
> better to make them behave similarly.
>
> I have already thought about adding an OS-specific option to do
> that, but I have another problem with that. Imagine that your
> servers are down. You stop listening to the port. At the same time,
> someone else starts listening (eg: you start a new haproxy without
> checking the first one, or an FTP transfer uses this port, ...).
> What should be done when the servers are up again ? Haproxy will
> not be able to get its port back because someone else owns it.
>
> So, by lack of a clean and robust solution, I prefer not to
> experiment in this area.
>
Received on 2009/08/04 09:18

This archive was generated by hypermail 2.2.0 : 2009/08/04 09:30 CEST