Tuesday, July 12, 2011

Azure Traffic Manager - Keep Alive and Round Robin

As you know Azure came out with the Traffic Manager which is essentially another load balancing layer on top of their standard round robin based load balancing layer.
Before the Traffic manager one workaround was to use RoleEnvironment.StatusCheck event to get the latest state of your service, and call SetBusy to take a particular instance out of load balancer queue for 10 secs. Similarly, there were few other work a rounds that required you to keep track of what your VMs are doing, and accordingly re-direct the traffic to prevent any one instance from being bogged down and become unresponsive.
But yet still no load balancing technique that actually balances by some load diagnostic such as cpu usage.
So what happens in the following case:

Normally if you have multiple requests coming in from the same ip address, and have "Keep Alive" set on, all those requests would be sent to just one instance, right?

Yes, and this round robin technique might be ok for a standard website, but not for an application where tons of data is being sent to it from many single point locations, and must be optimized for speed.

Taking keep alive off would solve the problem but each request would have to establish a new connection and the performance hit is about 10 fold.

The good news is that this is a big difference with the Traffic Manager round robin pattern. For some reason we get the performance gain of setting  "Keep Alive" on, and the round robin is dispersed by request and not by source location, which basically simulates a cpu usage based load balancing technique. Hooray!

Azure Traffic Manager

Windows Azure Traffic Manager is a new feature that allows customers to load balance traffic to multiple hosted services. Developers can choose from three load balancing methods: Performance, Failover, or Round Robin. Traffic Manager will monitor each collection of hosted service on any http or https port. If it detects the service is offline Traffic Manager will send traffic to the next best available service. By using this new feature businesses will see increased reliability, availability and performance in their applications.

The Windows Azure Traffic Manager CTP is now available. We would like you to try it out and provide feedback. During the CTP period, Windows Azure Traffic Manager is free of charge, and invitation-only. To request an invitation, please visit the Beta Programs section of the Windows Azure Portal.