Load Balancer balancing behavior

Frame, Grant 6 Reputation points
2022-10-31T16:46:23.297+00:00

We have deployed a load balancer and attached a small number (3) of instances to handle incoming connections. We have set this up to use the default distribution mode which i understand is a 5 tuple. We then have 1 instance connecting to the Load Balancer. Per my understanding since each successive client connection will use a different client port that means that each connection gets its own unique hash. We were seeing that for a small number of connections - around 10-15 or so we say all going to 1 node attached to load balancer. They were not spread out over multiple nodes. So my question is how are the hashes split? are there just buckets and then hash determines which bucket the connection gets routed to? Is there a way to do a more round-robin type of split?

Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
506 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 50,021 Reputation points Microsoft Employee Moderator
    2022-11-01T11:08:54.6+00:00

    Hello @Frame, Grant ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you would like to know Azure load balancer distribution works and how to do a more round robin type of load balancing for your VMs.

    Azure load balancer distribution is not round robin. It's hash based load balancing.

    Azure Load Balancer supports two distribution modes for routing connections to your load-balanced applications:

    • Hash based
    • Source IP affinity

    The default distribution mode for Azure Load Balancer is a five-tuple hash.
    Hash-based mode has one configuration type:

    • None (hash-based) - Specifies that successive requests from the same client may be handled by any virtual machine.

    Refer : https://learn.microsoft.com/en-us/azure/load-balancer/concepts
    https://learn.microsoft.com/en-us/azure/load-balancer/distribution-mode-concepts

    There is an insights called flow distribution which helps you visualize and manage the number of flows your backend instances are receiving and producing.

    From the Insights blade of your Load Balancer, click on the View detailed metrics and then select the Flow Distribution tab.
    Refer: https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-insights#flow-distribution

    NOTE : Please note this feature is in Preview and the functional dependency view and preconfigured dashboard may change to improve this experience.

    If you need a more round-robin type of load balancing, then I would suggest you to go with Azure Application gateway.

    When the Application gateway selects the backend pool, it sends the request to one of the healthy backend servers in the pool (y.y.y.y). The health of the server is determined by a health probe. If the backend pool contains multiple servers, the application gateway uses a round-robin algorithm to route the requests between healthy servers. This load balances the requests on the servers.
    Refer : https://learn.microsoft.com/en-us/azure/application-gateway/how-application-gateway-works

    Kindly let us know if the above helps or you need further assistance on this issue.

    ----------------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.