How to verify Azure Load Balancer?

拥有回忆 提交于 2020-01-01 11:42:06

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/10666846/how-to-verify-azure-load-balancer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!