[ovs-dev] [PATCH 2/2] bond: Change rebalance ratio to be more fair

Zoltan Kiss zoltan.kiss at citrix.com
Thu Jan 3 17:25:31 UTC 2013


Hi,

What do you thin about this another rebalance change? Even with the flow 
tagging fix I've seen decreased performance as vswitchd shifts traffic 
around all the time unnecessarily:

Jan  3 17:18:08 localhost ovs-vswitchd: 00083|bond|INFO|bond bond0: 
shift 105838kB of load (with hash 3) from eth3 to eth1 (now carrying 
74971kB and 105838kB load, respectively)
Jan  3 17:18:13 localhost ovs-vswitchd: 00092|bond|INFO|bond bond0: 
shift 588010kB of load (with hash 3) from eth1 to eth3 (now carrying 0kB 
and 1153733kB load, respectively)
Jan  3 17:18:13 localhost ovs-vswitchd: 00095|bond|INFO|bond bond0: 
shift 0kB of load (with hash 79) from eth3 to eth1 (now carrying 
1153733kB and 0kB load, respectively)
Jan  3 17:18:13 localhost ovs-vswitchd: 00098|bond|INFO|bond bond0: 
shift 565722kB of load (with hash 184) from eth3 to eth1 (now carrying 
588011kB and 565722kB load, respectively)

Regards,

Zoli

On 20/12/12 21:55, Zoltan Kiss wrote:
> The old algorithm tries to converge to 0, despite it would mean a very
> unbalanced situation. 1 is a more desirable goal. Fortunately rebalancing never
> worked, so this never caused a problem. But my previous patch needs it.
> It was tested together with my previous patch.
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss at citrix.com>
> ---
>   lib/bond.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/bond.c b/lib/bond.c
> index ba98fff..2149653 100644
> --- a/lib/bond.c
> +++ b/lib/bond.c
> @@ -21,6 +21,7 @@
>   #include <limits.h>
>   #include <stdint.h>
>   #include <stdlib.h>
> +#include <math.h>
>
>   #include "coverage.h"
>   #include "dynamic-string.h"
> @@ -771,8 +772,8 @@ choose_entry_to_migrate(const struct bond_slave *from, uint64_t to_tx_bytes)
>           delta = e->tx_bytes;
>           old_ratio = (double)from->tx_bytes / to_tx_bytes;
>           new_ratio = (double)(from->tx_bytes - delta) / (to_tx_bytes + delta);
> -        if (old_ratio - new_ratio > 0.1) {
> -            /* Would decrease the ratio, move it. */
> +        if ( fabs(new_ratio-1) < fabs(old_ratio-1) ) {
> +            /* Ideal ratio is 1, move it if the new ratio is closer to it. */
>               return e;
>           }
>       }
>




More information about the dev mailing list