News from the company...

Monitor Windows Azure Service Dashboard!

clock January 22, 2014 23:28 by author Igor Papirov

AzureWatch users can now receive notifications when changes are published to the Windows Azure Service Dashboard.  Upon logging into AzureWatch portal, users can choose to subscribe to any of the Azure Service Dashboard feeds as shown in the screenshot below.  This feature is available free of charge to active AzureWatch users.

 

AzureWatch Dashboard notifications



Windows Event Log monitoring with AzureWatch

clock January 6, 2014 06:38 by author Igor Papirov

This week we are excited to release a long-requested feature in AzureWatch: support for active monitoring of Windows Event Logs.  We are starting things off with support for Application, System and Security logs in Windows Azure Cloud Services (Web or Worker Roles) and Windows Azure Virtual Machines.

Users can now create rule-based alerts that match against entries in a particular Event Log, against a specific event log level, name of the publishing application or text of the entry itself.  We've enhanced our Rules engine to support string comparison and search capabilities.  Even though the extra workload to accommodate monitoring of Event Logs is significant, this feature will be available at no additional charge to users who are already monitoring their servers with AzureWatch.

In order to enable Event Log monitoring, users need to specify which logs should AzureWatch be monitoring and at what level.  Take care to not overwhelm monitoring cycles by asking AzureWatch to inspect too much data per cycle.  Checkboxes and Minimum severity level that users can specify on the Role configuration screen will control how much data is being sent to AzureWatch. Hundreds of log entries per minute should be OK, but once the number of log events gets into thousands per minute, users with a lot of servers may notice slowdowns of their monitoring cycles.

Turn on Event Log monitoring

 

After instructing AzureWatch (and via AzureWatch, Windows Azure itself) as to what Event Log data needs to be transferred to Windows Azure Diagnostics Table Storage or captured through Powershell Remoting, users can create custom alert or management rules based on the Event Log data.  We've enabled a number of Event Log specific variables that can be used in formulas of rules as shown in the screenshot below.  Every event log entry captured during a particular monitoring cycle will be evaluated against user-specific formula until a first matching log entry is found.  Users can combine aggregate metrics together with Event Log based search criteria to create sophisticated rules.  For example, it is possible to create a monitoring rule that looks for .NET errors that occur only when average CPU utilization is over 70%.  In order to support text-search capabilities in our engine, we've added ability to search text-based variables via three new functions: Contains, EndsWith and StartsWith, all of which return TRUE or FALSE when called from the rule's formula

 

Going forward we intend to further enhance the engine by providing numeric counts of events that match particular criteria to the rules engine, so that users can create rules based not only on individual log entries but also based on quantity of specific events found.

 

Do you have any feedback as to what you'd like to see from AzureWatch?  Please do not hesitate to contact us!



Windows Azure Auto-scaling Options Side-by-Side Comparison

clock July 29, 2013 23:07 by author Igor Papirov

Gone are the days when AzureWatch was the only option for auto-scaling of Windows Azure cloud services.  Today, basic auto-scaling support is also offered in Windows Azure itself (free while in beta) and is available as a WASABi Enterprise Library for the do-it-yourself and host-it-yourself types.

This article examines the Pro's and Con's of each approach and explains when using AzureWatch's advanced features makes sense.  A quick reference guide is provided toward the end that documents the differences between three offerings in a side-by-side comparison table.

When it comes to ability to auto-scale, manage, heal and monitor various Windows Azure resources, Enterprise Library WASABi, native Windows Azure monitoring and autoscaling and AzureWatch all offer different features to satisfy different needs.

  • WASABi is great for folks who like to have complete control over their scaling implementation, do not mind tinkering with settings on lower level, and do not really need monitoring of such Azure services as SQL Azure or Storage.  WASABi allows users to deploy their own scaling engines, provide sophisticated XML-based configuration sets and basically tinker with things in depth.  Users running WASABi are also responsible for hosting and monitoring it.
  • Windows Azure's native support for auto-scaling was recently added into the platform itself.  This is a great option for users who prefer simplicity over flexibility and probably targets smaller or non-mission critical applications.  It is also great for users who are just starting out with Windows Azure and are not yet sure what features from an auto-scaling platform they need.
  • AzureWatch's strengths lie somewhere in the middle of the other two options.  It offers endless abilities to tinker with settings of its auto-scaling engine, albeit not at the same level of depth as WASABi, but at the same time it provides a nice configuration UI and a fully managed environment.   Furthermore, it supports monitoring of SQL Azure, Storage, and has a ton of other features that make it compelling for businesses running serious applications on the Azure platform.
    On top of supporting all of the customary auto-scaling options like upper/lower boundaries, throttling, etc. AzureWatch also allows scheduled-based scaling, ability to restart/re-image misbehaving VMs, scheduled-based shutdown-startup of servers, ability to scale based on rate of change in demand, ability to evaluate complex boolean rules, and tons of other features that its users have requested over the years to support their sophisticated monitoring and scaling strategies.
    AzureWatch is a commercial product not owned by Microsoft and while not expensive, it is not free and may not be the best choice for users who are just playing around with Windows Azure platform or who run small personal websites.

 

 

Windows Azure

WASABi

AzureWatch

Platform Coverage

     

Cloud Services (Web/Worker Roles)

Yes Yes Yes

Virtual Machines (in Availability Sets)

Yes No Yes

Virtual Machines (stand-alone)

No No Stop/Start/Reboot

Azure Websites

Yes No Yes

Azure Mobile Services

Yes No Not Yet

SQL Azure & Federations

No No Monitoring

Azure Storage

No No Monitoring

URL Endpoints

Monitoring (up to 2) No Monitoring (no limit)
       

Scaling Features

     

Frequency of Monitoring

5 minutes custom 1 minute

Performance Counter Evaluation

CPU Utilization Only Any Any

Queue Depths Evaluation

Storage & Service Bus Storage & Service Bus Storage & Service Bus

Scaling Cooldowns

Yes Yes Yes

Scheduled Scaling

No Yes Yes

Monitoring of Running Averages

60 minute (CPU only) custom up to 24hrs

Scale down to 0 servers
with Virtual Machines

No No Yes

Advanced scaling formulas with
running averages

No Yes Yes
       
       

Other

     

Simplicity of use and ease of
integration with Windows Azure

Simple Advanced Medium

Pricing

Free, while in beta Self-hosting
costs only
<$10 server/month

User Interface

Built into Windows Azure None AzureWatch
Management 
Studio

 

 

 



Introducing preview of auto-scaling, healing, and monitoring of Azure VM's (IaaS)

clock July 23, 2013 12:55 by author Igor Papirov

We are excited to introduce the long-awaited AzureWatch support for monitoring, manage, auto-scaling and healing of Azure Virtual Machines.  We are soft launching this functionality in preview mode and are looking for your feedback!

 

Functionality Overview:

Every minute of every hour, AzureWatch will connect through Powershell Remoting to any Azure VM's that is either stand-alone or a part of an availability set.  Once connected, it will capture any number of standard or custom Windows performance counters that have been configured by you and execute its usual suite of monitoring or scaling Rules.  After the Rules execute, AzureWatch can execute scaling, re-imaging, stop/start and alerting actions. Please refer to the following table to see what actions are supported under what conditions:

 

 Performance CountersQueues & Other MetricsAuto-ScalingAuto-RebootingAuto-Stop/StartAlerts
Stand-alone Windows VMs Supported Supported   Supported Supported Supported
Stand-alone Linux VMs   Supported   Supported Supported Supported
Windows-based Availability Sets Supported Supported Supported Supported Supported Supported
Linux-based Availability Sets   Supported Supported Supported Supported Supported

 

It is important to know that stand-alone Virtual Machines cannot be auto-scaled because they are not load-balanced by Windows Azure.  However, when a VM is part of an Azure Availability Set, it can be scaled up or down, provided that there are enough shutdown VM's that exist within the Availability Set.  During the scale-up event of an availability set, AzureWatch finds the next available VM that has been turned off and simply starts it up.  Conversely, when an Availability Set is scaled-down, AzureWatch simply finds the last active VM and shuts it down so that charges are not incurred.

 

The following must be done in order to have AzureWatch properly monitor Azure VM's:

AzureWatch currently supports capture of performance counters only from Windows-based VMs that have Powershell Remoting enabled.  Powershell Remoting port 5986 must be open within the Windows Firewall on the server itself.  In addition, a public endpoint mapping to local port 5986 must be defined in the Azure configuration of each monitored Virtual Machine.  Azure's public port can be any number.

Users who wish to auto-scale or auto-shutdown/start-up their VM's based on a schedule or queue counts, do not need Powershell Remoting enabled and are not limited to running Windows Server.



Active monitoring of Azure Storage, websites, and SQL Azure

clock March 7, 2012 00:46 by author Igor Papirov

In the last few weeks, we released a colossal amount of new features to AzureWatch! Active monitoring of Websites, Azure Storage accounts, and SQL Azure databases just to name a few. We've also drastically improved capabilities of our Rules engine to allow for more complex rules.  In addition, we improved our Android and Mobile applications to allow for more streamlined access at seeing Azure application's health from smartphones.

For over a year now, AzureWatch has been helping customers with monitoring and auto-scaling of their systems in Windows Azure.  We're very excited about the new capabilities of our service and are looking forward to working on our next major featureset: implementation of monitoring of SQL Azure Federations.



Free Azure resource-monitoring utility: AzurePing

clock October 25, 2011 07:49 by author Igor Papirov

We are pleased to announce the release of AzurePing: a free Azure resource-monitoring utility.  AzurePing is a simple Windows Service that pings any number of Azure Storage resources, SQL (Azure) databases, and web URL's on a continuous basis.  Any errors are logged through log4net framework via a variety of appenders, such as email, SQL, flat files, Trace, etc.  For those not familiar with log4net, it is a popular open-source logging framework that can store logging entries to a variety of extendable appenders.

To find more information about AzurePing, visit our website at http://www.paraleap.com/azureping

And please help us spread the word about AzurePing!



Managing environments in a distributed, Azure, or other cloud based Visual Studio solution

clock September 13, 2011 05:00 by author Igor Papirov
During development, testing and support stages of the project, there is usually a need to test or debug code against multiple environments: Local with and without Azure emulation, Dev environment, QA environment, UAT environment, perhaps even Prod environment, etc.  Configuration changes can get very complicated when servers, URL’s, connection strings, etc. need to switch in unison when switching between different environments.  In general, handling more than one environment from Visual Studio can be very laborious when the overall project structure is complex.  Throwing Windows Azure in the mix only adds to debugging and deployment vows.

This article will describe techniques that we use to manage configuration changes among various projects in a large distributed Azure-based solution called AzureWatch and keep settings in sync as various environments are targeted during development, testing, and debugging sessions.  AzureWatch is an auto-scaling and monitoring system for Windows Azure applications.  By its nature it utilizes multiple WCF services, a few Windows-based clients and services, a number of web-based projects.  As readers can imagine, keeping all configuration settings in sync and "shifting" them together on demand without making a mistake can be challenging.

Visual Studio technologies utilized

 

Approach at a high level

For every debugging environment, create Visual Studio Configuration.  Break out sections from every .Config file that vary by environment and include them back via ConfigSource settings.  Include these sections as unique files into a separate Config project that has folders for every Configuration.  Also, copy *.csdef and *.csccfg files from Azure-related projects into these folders as well. In each folder, customize the broken off partial configuration files (that are included via ConfigSource) and azure configuration files. Create Post or Pre-Build event of the Config project to xcopy the files from a folder that matches current Configuration environment to root folder of Config project.  Include files from root folder of Config project into other projects as needed via “Add as Link” command.

Utilize Config transformations to instrument Production (and other environments if needed) specific configuration changes that deal with security, debugging, tracing, etc.

 

Now, let's look at these steps in detail:

 

Step 1

Create as many Visual Studio Configurations as necessary to support number of different environments that developers must be able to debug from Visual Studio

 

Step 2

Create a separate empty project that is a part of the overall solution called Config.  Include into the project folders, one per matching Visual Studio Configuration environment that were created in Step 1

 

Step 3

Break-off Connection strings, end-point configuration, and other environment-specific sections from existing .config files into separate “include-only” config sections.

Source example web.config:

  <connectionStrings configSource="config\connectionStrings.config"/>

Broken off example connectionStrings.config:

  <connectionStrings>

    <add connectionString="..." name="db_connection"></add>

  </connectionStrings>

 

May want to make sure that web-projects have "bin" folder as a part of the relative path: "\bin\config\partialConfigFileName.config"

Step 4

Include separate customized partial .config files and Azure-specific .cscfg files under every sub-folder within Config project

 

 

 

 

 

Step 5

Customize Pre-Build event for Config project to copy config files for current configuration to root folder:

xcopy /Y /R "$(ProjectDir)$(ConfigurationName)\*.config" "$(ProjectDir)"

xcopy /Y /R "$(ProjectDir)$(ConfigurationName)\*.cscfg" "$(ProjectDir)"

 

Step 6

Add-as-Link partial .config files into main projects from the ROOT of the Config project.  To keep things organized, feel free to include partial .config files under Config sub-folders.  Do the same with Azure-specific .cscfg files

Files added as links have a shortcut icon in Solution Explorer

Step 7

Manually add project dependencies to Config project from the other projects in the solution, that need partial config files to function.  This will ensure that Config project is built before other projects.  Project Dependencies can be found inside Solution Properties window, under "Project Dependencies" tab.

Do not forget to specify that partial config files set "Copy to Output Directory" as "Copy if Newer"

 

Step 8

You can still use Config Transformations to strip out debug information from Release configuration setting that will be ultimately used for publishing.

 

Conclusion

Now, every time you debug and run, the pre-compile event from Config project will copy all the files from its particular environment folder into its root folder.  And all other projects that link to this root folder for their partial .config files will automatically get updated .configs switched to proper environment in unison.

 

Revisions

This blog was revised on 06/10/2012 to include the extra XCOPY step that keeps Azure cscfg/csdef files in sync with the Config project

 



Auto scaling strategies for Windows Azure, Amazon's EC2 and other cloud platforms

clock May 23, 2011 17:05 by author Igor Papirov

The strategies discussed in this article can be applied to any cloud platform that has an ability to dynamically provision compute resources, even though I rely on examples from AzureWatch auto scaling and monitoring service for Windows Azure

The topic of auto scaling is an extremely important one when it comes to architecting cloud-based systems.  The major premise of cloud computing is its utility based approach to on-demand provisioning and de-provisioning of resources while paying only for what has been consumed.  It only makes sense to give the matter of dynamic provisioning and auto scaling a great deal of thought when designing your system to live in the cloud.  Implementing a cloud-based application without auto scaling is like installing an air-conditioner without a thermostat: one either needs to constantly monitor and manually adjust the needed temperature or pray that outside temperature never changes.

Many cloud platforms such as Amazon's EC2 or Windows Azure do not automatically adjust compute power dedicated to applications running on their platforms.  Instead, they rely upon various tools and services to provide dynamic auto scaling.  For applications running in Amazon cloud, auto-scaling is offered by Amazon itself via a service CloudWatch as well as third party vendors such as RightScale.  Windows Azure does not have its own auto scaling engine but third party vendors such as AzureWatch can provide auto scaling and monitoring.

Before deciding on when to scale up and down, it is important to understand when and why changes in demand occur.  In general, demand on your application can vary due to planned or unplanned events.  Thus it is important to initially divide your scaling strategies into these two broad categories: Predictable and Unpredictable demand.  

The goal of this article is to describe scaling strategies that gracefully handle unplanned and planned spikes in demand.  I'll use AzureWatch to demonstrate specific examples of how these strategies can be implemented in Windows Azure environment.  Important note: even though this article will mostly talk about scale up techniques, do not forget to think about matching scale down techniques. In some cases, it may help to think about building an auto scaling strategy in a way similar to building a thermostat.

 

Unpredictable demand

Conceptualizing use-cases of rarely occurring unplanned spikes in demand is rather straight forward.  Demand on your app may suddenly increase due to a number of various causes, such as:

  • an article about your website was published on a popular website (the Slashdot effect)
  • CEO of your company just ordered a number of complex reports before a big meeting with shareholders
  • your marketing department just ran a successful ad campaign and forgot to tell you about the possible influx of new users
  • a large overseas customer signed up overnight and started consuming a lot of resources

Whatever the case may be, having an insurance policy that deals with such unplanned spikes in demand is not just smart.  It may help save your reputation and reputation of your company.  However, gracefully handling unplanned spikes in demand can be difficult.  This is because you are reacting to events that have already happened.  There are two recommended ways of handling unplanned spikes:

Strategy 1: React to unpredictable demand

When utilization metrics are indicating high load, simply react by scaling up.  Such utilization metrics can usually include CPU utilization, amount of requests per second, number of concurrent users, amounts of bytes transferred, or amount of memory used by your application.  In AzureWatch you can configure scaling rules that aggregate such metrics over some amount of time and across all servers in the application role and then issue a scale up command when some set of averaged metrics is above a certain threshold.  In cases when multiple metrics indicate change in demand, it may also be a good idea to find a "common scaling unit", that would unify all relevant metrics together into one number.

 

Strategy 2: React to rate of change in unpredictable demand

Since scale-up and scale-down events take some time to execute, it may be better to interrogate the rate of increase or decrease of demand and start scaling ahead of time: when moving averages indicate acceleration or deceleration of demand.  As an example, in AzureWatch's rule-based scaling engine, such event can be represented by a rule that interrogates Average CPU utilization over a short period of time in contrast to CPU utilization over a longer period of time

 

(Fig: scale up when Average CPU utilization for the last 20 minutes is 20% higher than Average CPU utilization over the last hour and Average CPU utilization is already significant by being over 50%)

Also, it is important to keep in mind that scaling events with this approach may trigger at times when it is not really needed: high rate of increase will not always manifest itself in the actual demand that justifies scaling up.  However, in many instances it may be worth it to be on the safe side rather than on the cheap side.

 

Predictable demand

While reacting to changes in demand may be a decent insurance policy for websites with potential for unpredictable bursts in traffic, actually knowing when demand is going to be needed before it is really needed is the best way to handle auto scaling.  There are two very different ways to predict an increase or decrease in load on your application.  One way follows a pattern of demand based on historical performance and is usually schedule-based, while another is based on some sort of a "processing queue".

 

Strategy 3: Predictable demand based on time of day

There are frequently situations when load on the application is known ahead of time.  Perhaps it is between 7am and 7pm when a line-of-business (LOB) application is accessed by employees of a company, or perhaps it is during lunch and dinner times for an application that processes restaurant orders.  Whichever it may be, the more you know at what times during the day the demand will spike, the better off your scaling strategy will be.  AzureWatch handles this by allowing to specify scheduling aspects into execution of scaling rules.

 

 

Strategy 4: Predictable demand based on amount of work left to do

While schedule-based demand predictions are great if they exist, not all applications have consistent times of day when demand changes.  If your application utilizes some sort of a job-scheduling approach where the load on the application can be determined by the amount of jobs waiting to be processed, setting up scaling rules based on such metric may work best.  Benefits of asynchronous or batch job execution where heavy-duty processing is off-loaded to back-end servers can not only provide responsiveness and scalability to your application but also the amount of waiting-to-be-processed jobs can serve as an important leading metric in the ability to scale with better precision.  In Windows Azure, the preferred supported job-scheduling mechanism is via Queues based on Azure Storage.  AzureWatch provides an ability to create scaling rules based on the amount of messages waiting to be processed in such a queue.  For those not using Azure Queues, AzureWatch can also read custom metrics through a special XML-based interface.

 

Combining strategies

In the real world, implementing a combination of more than one of the above scaling strategies may be prudent.  Application administrators likely have some known patterns for their applications's behaviour that would define predictable bursting scenarios, but having an insurance policy that would handle unplanned bursts of demand may be important as well.  Understanding your demand and aligning scaling rules to work together is key to successful auto scaling implementation.

 



Squeeze out the every paid-for minute from Windows Azure!

clock May 20, 2011 17:26 by author Igor Papirov

Did you know that Windows Azure billing is done by the clock hour?  This means that if you scaled up an extra instance at 3:30pm and scaled down that instance at 4:30pm, you will incur charges for two hours: for 2-3pm clock hour, and for 3-4pm clock hour.  Thus, it may make sense to scale down only when the clock hour nears its completion.  To take advantage of this, latest version of AzureWatch introduces a new flag to allow for rules to be evaluated only during certain times in a clock hour.  Why scale-down in the beginning or middle of the hour, if the full hour was already paid for?



While Microsoft does not guarantee a specific time span within which instances will actually be deallocated after a scale-down request, Windows Azure is pretty good about deallocating instances only within a few minutes time.  In light of this, it might be prudent to not let the scale-down window to be too near the end of the clock hour, this can help avoid overruns into a new clock hour.



Data Storage in Azure: SQL Azure or Azure Table Services?

clock April 5, 2011 14:16 by author Igor Papirov

A question frequently asked during architectural stages of a new Azure-based project: should we choose SQL Azure or Azure Table Storage to store our data?

Answer is typically: YES. Both of these storage technologies compliment rather than compete with each other.  If you are looking to gain maximum scalability, performance, and flexibility while at the same time paying the least amount of money, the trick is to understand the strong points of each technology and utilize both effectively.

Azure Table Services (ATS) is a new storage technology from Microsoft and is specifically designed to handle mega-scalability for applications and websites of Twitter/Facebook/Amazon's capacity.  Storage space is super cheap with ATS.  To offset the low cost and mega-scalability there are a few negative impacts that one must be aware of.  You are not only paying for storing the data, but also for accessing the data that lives in ATS.  There is also only limited support for transactions.  This is key to understand and design around.  ATS also is a new paradigm for developers to grasp.  Lastly, ATS forces your compute nodes to become mini-relational servers.  It simply does not do any of the relational processing we are all used to.  JOINs, GROUP BY's, ORDER BY's all have to be designed around or performed manually. 

I would say that ATS is best suited for large amounts of data that only rarely needs to be accessed or massaged.

On the other hand, SQL Azure is a fast, lighter-weight cloud-based relational storage.  Your developers will know how to code against it right away, because (barring a few small gotchas) coding for it simply like coding for any other SQL database.  On the negative side: SQL Azure is not meant to support huge applications like Facebook, Ebay, Twitter, etc.  Azure, stores your SQL Azure databases along with others in a multi-tenant environment on same servers and thus it has to throttle access should your application become too hot and impacts other databases on the same SQL Azure node.  SQL Azure is also somewhat pricey, at $10/gigabyte/month.  Having said, there is no cost to access the data stored in SQL Azure and there is plenty of CPU power dedicated to perform relational functionality on your data.  

I would recommend that SQL Azure for smaller amounts of frequently accessed data.

 

A few typical use-cases to illustrate the points:

Data in a banking system that stores customer account information along side a large amount of financial transactions would best divided across SQL Azure and ATS in the following way: Customer account information in SQL Azure, Financial Transactions in ATS.

Content for a large blog site should probably live in SQL Azure until it reaches a certain age and can be archived to ATS.



Five tips for creating cost effective Windows Azure applications

clock December 7, 2010 02:05 by author Igor Papirov

Cloud-computing providers in general and Windows Azure in particular offer nearly infinite scalability, virtually unlimited capacity, blazing performance and extremely quick provision times.  However, to properly take advantage of these great benefits, teams need to plan ahead and understand all potential pitfalls and challenges.  One of the more significant differences between development of on-premise applications and cloud applications is a rather direct correlation between choices made during construction of an application and its support costs after deployment.  Because of the Windows Azure pricing model, every inefficient architectural decision and every inefficient line of code will show up as an extra line item on your Azure invoice.

This article will focus on a few actionable items that you can do today to minimize the cost of your Windows Azure application tomorrow.  The list of items is by no means exhaustive, but it will get you and your team thinking about the impact of your choices in a new dimension.

First, let's analyze the popular moving blocks when it comes to Windows Azure pricing. While seemingly straightforward individually, it is their combination together - and with obvious influence of already existing non-functional requirements for scalability, performance, security, availability, etc. - that make architecture in the cloud be a complex jigsaw puzzle.

Compute hours - quantity and size of nodes (servers) and charged by hour when online
Transfer costs - data that crosses Microsoft's data center boundaries is subject to transfer charges.
Azure Table Storage (ATS) costs - charge by gigabyte per month for the amount of space used
ATS transaction costs - charges for the amount of requests to ATS your application will make
Size of the SQL Azure databases - every database that you host in SQL Azure is charged by size

There are costs for other less frequently used services like Azure AppFabric or Content Delivery Network (CDN) that are not covered in this article.

Tip 1 - Avoid crossing data center boundaries

This is fairly straightforward.  Data that does not leave Microsoft data center is not subject to Transfer charges.  Keep your communication between compute nodes, SQL Azure, and Table Storage within the same data center as much as possible.  This is especially important for applications distributed among multiple geo-locations.  If you must communicate between different geo-locations, limit communication to non-transactional, batch calls that occur less frequently while utilizing compression where it makes sense to cut down on the amount of data transferred.  Employ caching technologies where possible.

Tip 2 - Minimize the number of compute hours by using auto scaling

Compute hours will likely make up the largest part of your Azure bill and thus need to receive the greatest amount of attention.  It is important to remember that Windows Azure does not automatically scale down the number of compute nodes, even if there is little or no demand on your application.  Architect for and plan to have an automatic scaling strategy in place, where the amount of nodes increases when demand spikes up and decreases when demand tapers off.  This can easily cut your bill for compute hours in half.  Implementing a comprehensive auto-scaling engine can be more complex than it sounds.  While there are a number of open-source examples that show the basics of how this can be done, it is also a perfect opportunity to outsource the auto-scaling to third party services such as AzureWatch.

In order for auto-scaling to be most effective, group your system components by their scaling strategies into Azure Roles.  It is important to keep in mind that if you need high availability of your components and want to take advantage of Azure SLA, you will need to maintain at least two online nodes for each Azure Role you have deployed.

Tip 3 - Use both Azure Table Storage (ATS) and SQL Azure

Try to not limit yourself to a choice between ATS or SQL Azure.  Instead, it would be best to figure out when to use both together to your advantage.  This is likely to be one of the tougher decisions that architects will need to make, as there are many compromises between relational storage of SQL Azure and highly scalable storage of ATS.  Neither technology is perfect for every situation.

On one hand accessing SQL Azure from within the boundaries of a data center is free and SQL Azure offers a familiar relational model which most developers will be comfortable with, transactions that assure data integrity, integration with popular ORM frameworks such as Entity Framework or NHibernate, and compatibility with numerous tools that work with relational databases.  On the other hand, ATS offers vastly greater scalability than SQL Azure and can hold a nearly infinite amount of data at a fraction of SQL Azure's cost.  You are charged, however, for every request made to ATS, even within the boundaries of a data center.

From a cost perspective, SQL Azure makes sense when access to data is not required to be highly scalable and when the amount of data is limited.  ATS makes sense for large amounts of data or when serious scalability is needed.

Tip 4 - ATS table modeling

If you have made the choice to use Azure Table Storage, you have essentially committed to converting parts of your data access components into mini database servers.  Setting Blob storage aside which is primarily used for media files or documents, ATS provides three levels of data hierarchy (Table, PartitionKey, and RowKey) that can be accessed and navigated extremely efficiently.  However, anything beyond that will require custom code and CPU cycles of your compute nodes.  This is the key difference to work around.  It would be prudent to spend a significant amount of time modeling table storage with appropriate Blobs, Tables, PartitionKeys and RowKeys to accommodate for efficient data storage and retrieval strategies.  This will not only speed up your transactions and minimize the amount of data transferred in and out of ATS, but also reduce the burden on you compute nodes that will be required to manipulate data and directly translate into cost savings across the board.

Tip 5 - Data purging in ATS

Because you are charged for every gigabyte stored in ATS, it may be prudent to have a data purging strategy.  However, while it may seem like a straightforward problem in a world of relational databases, this is not the case with ATS.  Since ATS is not relational, deletion of each and every row from an ATS table requires two transactions.  In certain cases it may be possible to delete a single row using only one transaction.  Either way, this is extremely slow, inefficient and expensive.  A better way would be to partition a single table into multiple versions (e.g. Sales2010, Sales2011, Sales2012, etc.) and purge obsolete data by deleting a version of a table at a time.

Conclusion

Shift to cloud computing represents a major leap forward and enables almost everyone, from small companies to large enterprise, reduce their capital expenses, minimize time to market and significantly decrease support costs.  By investing even small effort into planning ahead, cloud computing can result in meaningful savings and benefits.



Setup auto-scaling for your Windows Azure applications in under 10 minutes!

clock November 10, 2010 15:26 by author Igor Papirov

So you are deploying your application on Windows Azure cloud platform.  One of the key features of a cloud platform like Azure is the ability to consume your compute resources with a utility model.  Pay for only what is used, whether storage space, compute power, or amount of data transferred. Dynamic allocation of more space or bandwidth is built-in to Azure, but with respect to compute power, Windows Azure allows you to issue scale up or scale-down commands relatively easily.  However, deciding when to do so can be a challenging task.  This blog entry describes a service AzureWatch and how it can dynamically scale Windows Azure applications.

Part One - Introduction

At its core, AzureWatch aggregates and analyzes performance counters, queue lengths, and other metrics and matches that data against user-defined rules. When a rule produces a "hit", a scaling action or a notification occurs.  You will need an account to install and use AzureWatch.  Follow this link to fill out a simple registration form.  After registration, download link for Windows-based configuration utility will be provided.

AzureWatch currently ships in two flavors: desktop edition and server-side edition.  Server-side AzureWatch will monitor and auto-scale your Azure applications from its cloud-based servers.  Desktop edition requires a special AzureWatch Monitoring agent to be installed on your premises.  In desktop-edition the agent is responsible for gathering metrics and initiating scaling events.

 

Part Two - Start Control Panel

After installation is complete, start AzureWatch ControlPanel and login with your newly created account.  You will be presented with a wizard to enter your Azure connection information. 

Subscription ID can be found on your Windows Azure developer portal.  If you do not already have the X.509 certificate, AzureWatch can create one for you.  Follow the hyperlink on the wizard to get detailed instructions on creation certificates.  It is a good idea to visit AzureWatch page to understand how your certificates and storage keys are kept secure.

After entering your account SubscriptionID and specifying a valid X.509 certificate, press Connect to Azure.  You will be presented with a list of storage accounts.  Storage account that is monitored by your Diagnostics Monitor is required.

 

On the next wizard page you can validate default settings for such things as throttle times, notification email, etc.

After the connection wizard is completed, AzureWatch will figure out what services, deployments and roles are present.  For each role found, you will be offered a chance to create simple predefined rules.

 

 

The few sample rules offered are simple rules that rely upon basic metrics. We will come back to these rules in a short while.  For now, wizards need to be completed.

 

Part Three - First time in Control Panel

After wizards complete, you are presented with a dashboard screen.  It likely contains empty historical charts since no data has been collected so far.  Navigation Explorer on the left shows various parameters that can be customized, while Instructions tab on the right shows context-sensitive instructions.

 

 

It is a good idea to visit the the Rules section to see the rules that have been defined by the wizard.  Two sample rules should be present and can be edited by double-clicking on each.  Rule Edit screen is simple yet powerful.  You can specify what formula needs to be evaluated, what happens when the evaluation returns TRUE, and what time of day should evaluation be restricted to.  To make formula entry easier, a list of already defined aggregated metrics is provided.  Hovering over the formula box will display allowed operands.

 

 

One last place to visit before starting the monitoring process is the screen that contains safety limits for the number of instances that AzureWatch can scale up to or down to.  By clicking on the appropriate Role name in the navigation explorer, you will be presented with a chance to modify these boundaries.

 

 

This is it.  If you are ready, press "Publish Changes" button.  Provided your AzureWatch Monitor service is running, it will pick up these configuration settings in the next iteration of its internal loop and instruct Azure Diagnostics Manager to start capturing the metrics required for formulas to work.  Windows Azure will need a few minutes to instruct your instances to start capturing those metrics afterwards, and then a few minutes more before these metrics will be transferred to your storage.  Thus, give AzureWatch at least 5-10 minutes before expecting to see anything on the Dashboard screen.

 

Part Four - A few tips and tricks

Some things to keep in mind while using AzureWatch

If you just started using AzureWatch and have not accumulated enough metric data, evaluation of your rules may be suspect as your aggregations will lack sufficient data.  It maybe prudent to disable scaling inside Rules in the beginning so that your scaling actions do not trigger unexpectedly.

Metric transfer occurs only when Monitor is running.  If you stopped Monitor service for an hour and then restarted it, it does not "go back" and send the missing hour's worth of metrics to AzureWatch.

When deploying new packages into Azure, you must use do it thru the same storage account that is specified in your DiagnosticsConnectionString and in AzureWatch System Settings.  Failure to do this, will result in incomplete or incorrect metrics.

AzureWatch will always instruct your instances to capture metrics that are defined in the Raw Metrics screen.  You do not need to do anything special with existing or newly started instances.  It may be worthwhile, however, to visit the System Settings screen to further configure how metric enforcement and gathering works.

AzureWatch will send a notification when it scales your instances up or down.  In it, it will provide values for all the aggregated metrics it knows about to help you understand why the scaling event occurred.

Locally installed AzureWatch components automatically self-update whenever a new version is released.