Weighted algorithm -for target Load balancing is not working as expected

I have a proxy in edge where I wanted to route req to 2 different targets based on below config.

	 <LoadBalancer>
            <Algorithm>Weighted</Algorithm>
            <Server name="Target-1">
                <Weight>1</Weight>
            </Server>
            <Server name="Target-2">
                <Weight>2</Weight>
            </Server>
        </LoadBalancer>
       


I have checked the message processor count for my proxy . It shows there are totally 6 MP.

I had triggered 12 req first and saw below order of routing


Target-1: 1,2, 5, 9, 12
Target -2: 3, 4, 6, 7, 8, 10, 11.

Just to see whether I am getting same order .. I have undeployed and deployed the same revision (just to clear the MP's Counter)

But this doesnt work

Target-1:1 2 7 8

Target-2: 3 4 5 6 9 10 11 12

Can someone help on this

0 5 271
5 REPLIES 5

I wouldnt expect any particular ordering given that there's n number of Message Processors processing your request and they're used at random, even if the load balancing algorithm was sequenced at MP level.

Is there a way to restrict only one MP for a particular proxy in an environment. I guess there will be issues with high availability. But is it possible?

I read somewhere about changing the router config properties to define the UUIDs of MPs to route the request to only those MPs, but I guess it will use the defined MPs for all proxies and not one in particular.

Why would you want to do this?

Hi @dane knezic
We wanted to route 80 % traffic to target-1 and 20% target to target-2 . What would be the efficient way to do it ? Suggestions much apprecited