Azure load balancer not distriburting traffic evenly

Samuel Andersson 1 Reputation point

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).


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.
421 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SaiKishor-MSFT 17,221 Reputation points

    @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!


    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