20

I was trying to read up on load balancing in Windows Azure, and all the information about it is extremely vague and non-specific. All I really want is a simple answer: how does Azure perform load balancing?

Many applications use sessions or in-memory data to increase performance. With Azure, I'm not sure if this is possible, because (from what I can tell), Azure doesn't have any sort of "sticky" sessions. Even if it wasn't session-based, but simply IP-based balancing, that would be enough for many applications.

So, the question of the day - how exactly does Azure perform its load balancing?

asked Feb 14, 2010 at 18:51
1

5 Answers 5

15

Ok to give a correct answer here - Azure DOES support load balancing in front of both web and worker roles (so the answer marked as best on this thread is completely wrong), but it does not support Affinity load balancing which is what jvenema was asking for I think. The current implementation uses round robin behaviour.

answered Nov 11, 2010 at 12:41
Sign up to request clarification or add additional context in comments.

4 Comments

Good clarification Andy; I appreciate that. I should have been clearer in the question initially.
What if there is only one client application which calls Azure based service; will this traffic always be routed to one particular web role?
@Tarkus - no it will still be sent round robin to all web roles you have deployed. There is no way to specifically target a particular role instance other than only have 1 instance deployed for that role.
While this answer was correct at the time it was written, MS have since changed their load balancing scheme. See my answer below.
7

Azure handles load-balancing for table storage and SQL Azure by distributing traffic across the instances you set up.

For things like session state with a traditional asp.net app, the session data would be stored in table storage, which would then be available to all your webrole instances. This is mentioned here.

Windows Azure provides load balancing across each public endpoint, allowing you to scale your application to as many instances as you'd like. You need to ensure that your application is stateless (or stores state in a common area across instances, such as blobs or tables). The only endpoints not load-balanced are internal endpoints. So, if you're doing some type of inter-role communication, like from a web role to one of several worker role instances hosting a wcf service on an internal endpoint, you'd need to handle load balancing across those instances.

answered Feb 15, 2010 at 16:00

Comments

7

While the load balancing used to be round robin, Microsoft have since changed the way they do the load balancing as described in this blog:

http://azure.microsoft.com/blog/2014/04/08/microsoft-azure-load-balancing-services/

The Microsoft Azure Load Balancer uses a 5 tuple (source IP, source port, destination IP, destination port, protocol type) to calculate the hash that is used to map traffic to the available servers

answered Nov 11, 2014 at 1:36

Comments

3

I realize this is an old question but we solved the Affinity problem by using Windows Web Farm Framework and creating a layer of proxy servers that support Affinity through to our web servers.

http://technet.microsoft.com/en-us/library/jj129385.aspx

This is the architecture recommended if you were self hosting and seems to apply equally to Azure. The layers look something like this...

Firewall: Azure Load Balancer (round-robin to proxy servers)

Proxy: Application Request Routing (ARR) to perform load balancing with Affinity to web servers, static and dynamic compression and SSL. Offloading SSL to the Proxy servers gives web servers additional processor time. Also, the Web Farm Framework is great for scaling as it manages each additional web server, copies application files, monitors health, switches online/offline, etc. You could have 10,000+ web servers managed by it.

Web: Normal web servers (no SSL, compression, etc. required).

Database: Normal database servers or Azure SQL.

It is recommended by Microsoft that you have at least two ARR (Proxy) servers. Some people will gawk at the additional cost in Azure. However, we discovered that Micro Instances (15ドル pm) are more than suitable as Proxy servers, if 5 mbit is sufficient speed.

Another alternative is to have two ARR server configured as Small Instances (65ドルpm @ 100 mbit) but have one turned off and only enable it at peak periods or when the first server fails (eg. maybe schedule second ARR server to start when first is running Windows Updates and stop an hour later).

It's a nuisance to set up but once it's working, it's very slick!

NOTE: There is some confusion in WFF documentation about the terms ARR, proxy and controller. They are usually all the same thing. Remember this if you try to set it up.

Rob
45.9k24 gold badges126 silver badges155 bronze badges
answered Jun 30, 2013 at 18:01

Comments

1

I think you might be looking for Windows Azure AppFabric and Velocity, specifically. Take a look at one of the PDC sessions for more info.

answered Feb 14, 2010 at 20:09

2 Comments

I've read about AppFabric - this is where we get into the "it load balances, but we're not going to tell you how" mumbo jumbo.
While AppFabric caching was the recommended solution at the time this answer was written, it has now been deprecated and MS now recommend using their hosted Redis cache blogs.msdn.com/b/appfabric/archive/2015/04/02/…

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.