question

SamuelAndersson-5967 avatar image
0 Votes"
SamuelAndersson-5967 asked ·

Azure load balancer not distriburting traffic evenly

Hello,
We have a setup with 2 VMs in azure, each running IIS with the same web site. The VMs are in a backend pool of an azure internal load balancer with session persistence set to 'none'.
When we do load testing and send traffic to the LB, we expected it to distribute the traffic evenly. But instead we see a strange behavior where 1 VM gets all the traffic for 20 seconds, then it switches to the other VM for about 20 sec and then back again.
See screenshot over cpu usage (looking at perf counter for incoming network traffic on the nic shows the exact same behavior).

79657-image.png



Are there any settings on the LB that can cause this behavior?

azure-load-balancer
image.png (631.3 KiB)
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SaiKishor-MSFT avatar image
0 Votes"
SaiKishor-MSFT answered ·

@SamuelAndersson-5967

By default, Load balancer uses a Five-tuple hash.

The hash includes:

Source IP address
Source port
Destination IP address
Destination port
IP protocol number to map flows to available servers
Affinity to a source IP address is created by using a two or three-tuple hash. Packets of the same flow arrive on the same instance behind the load-balanced front end.

The source port changes when a client starts a new flow from the same source IP. As a result, the five-tuple hash might cause the traffic to go to a different backend endpoint. For more information, see Configure the distribution mode for Azure Load Balancer.

I believe this is the reason why you may be seeing this behavior. Hope this helps. Let us know if you have any further questions/concerns. Thank you!

Remember:

Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

Want a reminder to come back and check responses? Here is how to subscribe to a notification.


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.