Azure load balancer not distriburting traffic evenly

Samuel Andersson 1 Reputation point
2021-03-19T15:31:07.403+00:00

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
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
401 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SaiKishor-MSFT 17,181 Reputation points
    2021-03-19T23:58:27.013+00:00

    @Samuel Andersson

    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.

    0 comments No comments