Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to verify Azure Load Balancer?

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

like image 374
ToinoBiclas Avatar asked May 19 '12 16:05

ToinoBiclas


People also ask

How do I ping Azure load balancer?

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.

How do I find my Azure load balancer IP address?

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.


1 Answers

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:

  1. Create two (or more) instances of your service with RDP access enabled so you can RDP to both instances
  2. RDP to your both instances and run NETMON or any network monitor solution in it.
  3. Now access your Windows Azure web application from your desktop
  4. You need to understand that when a network connection is made from your desktop the connection is still alive based on network settings (default 60 seconds) so you need to wait until default timeout is passed to access your Windows Azure web application again.
  5. When you will access your Windows Azure Web application again you can verify that seconds time the request went to next instance. BE sure to pass the connection timeout otherwise your request will be keep handled by same instance.

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.

like image 52
AvkashChauhan Avatar answered Oct 13 '22 01:10

AvkashChauhan