5

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

ToinoBiclas
  • 262
  • 4
  • 13

1 Answers1

9

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.

Dene
  • 578
  • 5
  • 9
AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65
  • My pleasure. This sure is a great question and I always wanted to document how to do it in my blog but atleast it is documented here so it is good. – AvkashChauhan May 19 '12 at 17:19
  • 1
    Let me clarify that you cannot count on any such algorithm in the load balancer, nor can you count on it being hardware- vs. software-based. While you may very well observe a round-robin pattern today, you cannot count on that. Further: Traffic Manager should not be thought of as a load-balancer for your role instances. It may only load-balance between multiple deployments of the same app across different data centers, through the public IP endpoint. – David Makogon May 19 '12 at 17:39