[sr-dev] git:master: dns: srv load balancing distribution fix

Iñaki Baz Castillo ibc at aliax.net
Tue Mar 13 01:55:44 CET 2012


2012/3/12 Andrei Pelinescu-Onciul <andrei at iptel.org>:
> The load distribution when doing SRV based load balancing was not
> completely fair. The first listed server had always an extra
>  (sum_of_weights-weight)/(sum_of_weights*(sum_of_weights+1) chance
> of being selected.
> For example for 2 servers both with weight 50, the first one
> will have an extra (100-50)/100*101 change of being selected =>
>  extra 0.495% which gives a 50.495% - 49.505% distribution
> instead of 50% - 50%. For large weight values this doesn't make a big
> difference (e.g. for 500-500 => 50.049% instead of 50%) but for
> small values it becomes very noticeable (e.g. for 1-1 =>
>  66% - 33% distribution instead of 50%-50%).
>
> The chance of selecting a 0-weight record was also changed. It was
>  1/(sum_of_weights+1) and now is 1/(sum_of_weights*1000).
>
> Reported-by: Michal Matyska  michal.matyska iptel org


Important improvement/fix!

-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-dev mailing list