Saturday, March 29, 2014

Load balancing using Windows Azure Virtual Machine

This is one of the common query everyone started using Windows Azure will have. How we can make a load balancer in case if we have to host a site which will be getting huge traffic. In windows Azure load balancing configuration is very simple. In this article we will go through how to configure load balancing in windows azure and also we will see how to deploy ASP.NET web applications in Windows Azure load balancing server.
Let’s go through step by step procedure.

First we have to see how to create virtual machine in Windows Azure. I have already posted the article “How to Create Virtual Machine in Windows Azure”. If you haven’t read that please go through that article first for the complete steps.
We will be repeating the same steps to create the second  virtual machine with a very small configuration change. Only difference for creating load balancing Virtual Machine in Windows Azure is to select the “CLOUD SERVICE” as the already created Virtual Machine cloud name. In this case it will be “Dotnetgalaxy”.
load balancing  
You may notice that. As soon as you select the existing cloud service from the dropdown, “CLOUD SERVICE DNS” will be disabled.
Once you create the VM you may notice that both machine will have the same DNS name.
Next one is the very important settings you have to do on your second Virtual Machine, that is adding the HTTP end point.
In this case since we already have the HTTP end point created for the First Virtual Machine we will do some slight modification in that END POINT. Just Click on the First Virtual Machine and go to END POINT tab.
Select HTTP end point and click on EDIT. Now select “CREATE A LOAD-BALANCED SET”
Click On the Arrow to configure the “LOAD-BALANCER SET NAME”. Here we will give the name as “dotnetgalaxy”
Now Click on the Tick mark to complete this configuration. Now we will add the HTTP end point in second Virtual Machine. Just click on the second Virtual Machine and go to END POINT tab. Click on ADD button to add the new HTTP END POINT.
This will open the pop up a window to configure the HTTP END Point. Here we will select the second option “ADD AN ENDPOINT TO AN EXISTING LOAD-BALANCING SET”. This will automatically shows the load balancing set name “dotnetgalaxy” we have already created few minutes back. This will appear only once you complete previous steps. It may take a minute or may wait until that configuration finishes.
Click Next to provide the END POINT name as HTTP and click on the Tick mark.
Now it is the time to deploy the ASP.NET web application. I have already written an article “How to Deploy ASP.NET web application in Windows Azure Virtual Machine”. Please go through this article and deploy your ASP.NET web application in first Virtual Machine.
Now let’s do the deployment is second Virtual Machine.
Here what we are going to do is, since we already have a site deployed in Virtual Machine 1 we will use the same deployed file and deploy it in second Virtual Machine.
We will copy the whole folder from dotnetgalaxy VM that is from first VM.
Now we will paste this in dotnetgalaxy1 VM that is in second VM
We will open IIS and convert this as web application.
Just browse the deployed application and see if it works fine.
That’s it, now when you access your application over the net it will open from load balancer based on the traffic on the server. Windows Azure supports Round robin algorithms. Microsoft didn’t announce clearly how this round robin works. You may explore more about the algorithms in MSDN.
In order to test whether load balancing is working, you can modify default.ASPX from each server and access it from the net.
I have changed the title of first VM’s default.aspx to “Windows Azure Demo ASP.NET Site - Windows Azure VM1”
I have changed the title of second VM’s default.aspx to “Windows Azure Demo ASP.NET Site - Windows Azure VM2”
Now we will browse the URL and see how applications are serving from different VM and how load balancing in windows Azure Virtual Machine works.
Load Balancing in Windows Azure


Dot net training chennai said...

Your information about asp is really interesting and innovative. Also I want you to share latest updates about asp. Can you update it in your website? Thanks for sharing

rebeka christy said...

Thanks for giving important information to training seekers,Keep posting useful information..

DOT NET Training Chennai

christina jeni said...

Thanks for sharing this useful information..Its really very informative.

Dot Net Training in Chennai

Andria BZ said...

Nice blog, here I had an opportunity to learn something new in my interested domain. I have an expectation about your future post so please keep updates.
Web design course in Chennai

varshini devi said...

It's really informative blog. thanks for sharing this useful information to our knowledge...
JAVA Training in Chennai|JAVA Training Institutes in Chennai

jhansi joe said...

This post having niche information to make myself updated. Angularjs is the extended version of HTML with new attributes. It’s a JavaScript framework that can be added to an html page with a tag of script.if you want to study
Angular training in chennai get into FITA.
Angular course in chennai | Angular training institutes in Chennai

dhanamlakshmi palu said...

Your posts is really helpful for me.Thanks for your wonderful post. I am very happy to read your post.very nice!!! i have to learning a lot of information for this sites...Sharing for wonderful information.Cloud Computing Training in chennai | Cloud Computing Training chennai | Cloud Computing Course in chennai | Cloud Computing Course chennai

Suranka VMware said...

Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.Nice article i was really impressed by seeing this article, it was very interesting and it is very useful for Learners.. VMWare course chennai | VMWare certification in chennai | VMWare certification chennai

Victoria John said...

Hi, Thanks for sharing this valuable blog.I was really impressed by reading this blog. I did HTML5 Training at reputed HTML5 Training Institutes in Chennai. This is really useful for me to make a bright future in designing field.

Manikumar Surya said...

Excellent Post !!!!

Best Java Training in Chennai | Best .Net Training in Chennai

geethu said...

Thanks for sharing this informative blog. If you are interested in taking .net in professional carrier visit this website.Dot Net Training in Chennai

Nikshitha S said...

Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
salesforce training in chennai | salesforce training institute in chennai

Nikshitha S said...

Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
Python Training in Chennai | Python Course in Chennai

Jhon Mick said...

Awesome Post! I like writing style, how you describing the topics throughout the post. I hope many web reader will keep reading your post at the end, Thanks for sharing your view.
website designing training|web designing classes in chennai