I want to be able to configure the Azure Load Balancer Emulator in such a way that two consecutive calls to the web app will always result in calls to different instances.
How am i able to perform that? How can i verify that the load balancer is working as expected? Using the HttpContext.Current.Request.Url and seing if the endpoint port changes?
Thanks in advance
Azure Load Balancer requires the configuration of load balancing rules to forward traffic to healthy Virtual Machines. These rules must be either TCP or UDP, ping however uses the ICMP protocol. A way to test connectivity through your Load Balancer is to ping on a specific port, which in turn results in a TCP request.
If you want to add a load balancer rule to your load balancer, go to your load balancer in the Azure portal, select Load-balancing rules, and then select +Add. The name of the load balancer rule. Your options are IPv4 or IPv6. Select the frontend IP address.
The default Load Balancer which are available to your Windows Azure Web and Worker roles are software load balancers and not so much configurable however they do work in Round Robin setting. If you want to test this behavior this is what you need to do:
Note: If you dont want to use RDP, you sure can also create a test ASP.NET page to write some special code based on your specific instance which will show you that this page is specific to certain instance. The best way to do is to read the Instance ID as below:
int instanceID = RoleEnvironment.CurrentRoleInstance.Id;
If you want to have more control over Windows Azure Load Balancing, i would suggest using the Windows Azure Traffic Manager which will help you to route the traffic to your site via Round-Robin, Performance or backup based scenario. More info on using Traffis Manager is in this article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With