Build Your Own SKYNET with the Windows Azure Auto-Scaling Application Block (WASABi)–Part 1

  Entlib_AutoScaling  Wasabi

The Windows Azure Auto- Scaling Application Block (WASABi) is now available as a beta release and it allows developers and IT professionals to add and manage *Automatic* Auto-Scaling capabilities for Windows Azure hosted services and applications.  The block is a part of the Windows Azure Integration Pack which is still in beta – but should be coming soon. 

One of the key benefits that Windows Azure delivers is the ability to rapidly scale your application in
the cloud in direct response to sudden changes in demand and/or for scheduled time periods to handle known peak and non-peak time periods.  These are key characteristics of an elastic cloud infrastructure.

When you deploy an application to Windows Azure, you deploy roles as either Web roles for the externally facing portions of your application and Worker roles to handle backend processing.

When you run your application in Windows Azure, your roles run as role instances (i.e. virtual machines). You can specify how many role instances you want for each of your roles: the more instances you have, the more computing power you have available for that role, and consequently the more it will cost you.

In Windows Azure, you can specify the number of instances you require for each your roles when you first deploy an application to Windows Azure.  You can also add or remove role instances "on the fly" while the
application is running, either manually through the Windows Azure portal, or programmatically by using the Windows Azure Management API.

By adding and removing role instances to your Windows Azure application while it is running, you can balance the performance of the application against its running costs. You can add new instances when demand is high, and remove instances when you no longer need them in order to reduce running costs. 

If you rely on manual interventions to scale your application, you may not always achieve the optimal balance between costs and performance: an operator may respond late, or underestimate the number of role instances that you need to maintain throughput.

The Windows Azure Auto- Scaling Application Block (WASABI) will now allow you to create logical rules to (almost) completely manage your cloud infrastructure to handle both peak loads and be as stingy as possible when it comes to deploying required infrastructure to manage web workloads and ultimately costs.

Below are a few code snippets and screenshots to give you an idea of the flexibility and power that the WASABI block  provides.

Basic Set-up – Constraint Rules:

Wasabbi_20

Rank = order of precedence for Rule Evaluations – *Remember this to prevent a full transition to SKYNET.

Range = You can set this by Role along with the minimum and maximum number of instances.

*Note: The “max” range setting can potentially have negative financial consequences.  Please don’t ask me how I know this. 

An automatic auto-scaling solution reduces the amount of manual work involved in dynamically scaling an application.

It can do this in two different ways:

  • Preemptively by adjusting the number of role instances based on a timetable rule.
  • Reactively by adjusting the number of role instances in response to some performance counter or measurement that you can collect from your application (business KPI) or from the Windows Azure environment.

Preemptive Rule Example:

Auto-Scale UP on the second Friday of the month at 3:25 pm for 5 minutes starting on 10/14/2011:

WASABI_25

 

Reactive Rules Example:

Spin Worker Role Instances Up or Down in Response to the Length of an Azure Queue:

Wasabbi_22

Resources:

Autoscaling Application Block - BETA 
https://entlib.codeplex.com/releases/view/74618

Windows Azure Autoscaling Block BETA is out
https://blogs.msdn.com/b/agile/archive/2011/10/13/windows-azure-autoscaling-block-beta-is-out.aspx

Summary:

The Windows Azure Auto-Scaling Block WASABI provides a huge leap forward in terms of allowing IT pros and developers to create a fully automatic, ,elastic, and scalable cloud infrastructure. The block includes a very flexible way to implement simple or complex rules to either react or plan computational resources.

Caveat: You will still need to have a “carbon-based-browsers” evaluate the results of your auto-scaling solution on a regular basis to ensure that it is delivering the optimal balance between costs and performance.  

Other than that bit of advice – enjoy your newly found work-life balance as a result of implementing a reactive and self-managed cloud infrastructure!

WASABISKYNET_23

Have fun!

*In my next blog post I will walk you through the WASABI installation process and how to create and host a simple example in Azure so you can see how powerful this capability can be for automatically scaling your cloud infrastructure.