Friday, March 9, 2012

Elastic Scaling on Azure using Enterprise Library 5.0

One of the Biggest advantage and reason for moving towards Cloud (in specific to Windows Azure) is it gives customers Elastic Scaling of their Application instance. That is Customer can have the ability to Scale in and scale out anytime according to his business needs. However, doing this manually is pain and involves lot of monitoring and Automation with Management APIs. Azure platform provides Auto-Scaling using Enterprise Library 5, which includes a robust auto-scaling implementation that's ready to use out of the box.

Why Auto-Scaling?
Before thinking about Scale-in and Scale-out, one needs to define the metrics and understand the Business needs. There are probably thousands of variants, but the two most common types of metrics on which scaling decisions are based are:

1> Schedule (Timelines), such as particular weeks in the month: One of the example i think about configuring Auto-scaling based on this metrics is, during Christmas month on a eShopping site, we can always increase number of instances of servers.

2> Key Performance Indicators (KPIs), such as CPU utilization or queue depth.

How to get Metrics?
The next important question to answer is, how to get these metrics. For Schedule the answer is pretty simple, we all know when is the Christmas month, so we can take the date or time range and can configure auto-scaling based on that. How ever getting details about KPIs is not that easy, we need to develop a small monitoring tool which uses CPU performance counters using DiagnosticMonitor. Based on this data we can configure Auto-scaling configuration for KPI.

How Auto-scaling Enterprise Library works?
Auto-Scaling Enterprise library comes with a component called "the Autoscaler", which can be hosted as web role on azure or on the local box (on IIS 7). This tool needs to be configured with Management Certificate of Azure Account for which you are planning to Auto-scale (Azure Account for which you want to enable Auto-Scale).
Once you configured Azure account (Web role, Worker process or Azure Blobs), it is time to provide Mertics data which we collected to Autoscaler (We call this Autoscaler rules).

Once "the Autoscaler" is up and running, it can Automatically Scale-in or Scale-out based on the Rules you provided.

for more information on how to configure and install Autoscaler, visit the nuget gallery. http://nuget.org/packages/EnterpriseLibrary.WindowsAzure.Autoscaling

No comments:

Post a Comment