On Wed, Oct 18, 2017 at 05:59:49PM +0000, Will Wheatley wrote:
> We are seeing an issue where using SDBM hash-type that the last server in the 
> pool is getting 100% of the traffic and the first server in the pool gets 0. 
> We also tried adding a 3rd server and the last server still got all the 
> traffic.
> All weights were 1.
> 
> A config sample:
> 
> backend VIP
>   http-reuse always
>   option httpchk GET /server-status HTTP/1.1\r\nHost:\ haproxy
>   balance source
>   hash-type consistent sdbm
>   default-server inter 2000ms fastinter 250ms downinter 1000ms fall 1 rise 2 
> slowstart 10s
>   server SERVER1 10.0.0.115:8080 check namespace haproxy
>   server SERVER2 10.0.0.116:8080 check namespace haproxy
>   server SERVER1:backup 10.0.0.115:8080 backup namespace haproxy
>   server SERVER2:backup 10.0.0.116:8080 backup namespace haproxy
> 
> We were able to resolve the issue by using sdbm avalanche.
> 
> Is this a known issue or a potential regression?

It's possible that you're having very few source IP addresses and that the
result of the hash makes them land on the same server. Without avalanche
nor consistent hashing, the hash result is divided by the total weight, so
with a total weight of exactly 2, you only use the last bit of the hash,
which possibly isn't much random. I already remember that sdbm must not be
used with total weight of 64 because it always divides badly. It's possible
that it divides badly with other values as well :-/

If avalanche is OK in your case, you can definitely keep it.

Cheers,
Willy

Reply via email to