camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashwin Karpe (Commented) (JIRA)" <>
Subject [jira] [Commented] (CAMEL-5039) Make WeightedRandomLoadBalancer really random
Date Tue, 28 Feb 2012 12:25:48 GMT


Ashwin Karpe commented on CAMEL-5039:

Hi Xavier,

Your analysis is entirely correct. My original implementation was weight-biased and the proposed
one is skewed towards randomness.

More importantly, upon closer review, your algorithm offers the right balance between weighting
and randomness. In addition, the solution offers better ability to test that the weighting
criteria is being met periodically.

I will review your code and apply it to the trunk.

Thanks for your input. I appreciate it.



Thank you for your thought and comments. 
> Make WeightedRandomLoadBalancer really random
> ---------------------------------------------
>                 Key: CAMEL-5039
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Xavier Fournet
>            Assignee: Ashwin Karpe
>         Attachments:,, current-impl-result.txt,
new-impl-result.txt, out.txt
> As Mark Harwood explained in last comment of CAMEL-3197 the WeightedRandomLoadBalancer
is not doing a good load balancing job if some weight are a lot bigger than some other weight.
> See in the attached example (current-impl-result.txt), the first and third routes are
always called at the very beginning of every 50 iterations loadbalancing round.
> I propose a modified algorithm that do a more balanced loadbalancing (new-impl-result.txt)
> Attached the test program with the proposed implementation.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message