1
votes

Using HA-Proxy 1.4.18 I am using balance source as the option to balance a tcp stream to 2 servers. However from an admittedly very small sample set of connections it appears that they all just go to the one server - the server listed first in the haproxy config.

  • listen videos *:1935
  • balance source
  • mode tcp
  • server server1 192.168.0.1:1935
  • server server2 192.168.0.2:1935

I have not seen it split the load onto the 2 boxes. This does work when I use balance roundrobin however for this particular application I cannot use this method.

Any ideas for an otherwise persistent session loadbalanced between these 2 machines from the clients?

Cheers

1

1 Answers

1
votes

How did you test the balance ?, the doc says :

The source IP address is hashed and divided by the total weight of the running servers to designate which server will receive the request. This ensures that the same client IP address will always reach the same server as long as no server goes down or up. If the hash result changes due to the number of running servers changing, many clients will be directed to a different server. This algorithm is generally used in TCP mode where no cookie may be inserted. It may also be used on the Internet to provide a best-effort stickiness to clients which refuse session cookies. This algorithm is static by default, which means that changing a server's weight on the fly will have no effect, but this can be changed using "hash-type"

If you tested with just 2 different IP source you maybe fall in a particular case.