Documente Academic
Documente Profesional
Documente Cultură
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
Table of Contents
Introduction .................................................................................................................................................. 3 The Business Need for Auto Scaling.............................................................................................................. 3 Example Scenarios for Auto Scaling .......................................................................................................... 3 Major benefits of using Auto Scaling ........................................................................................................ 4 Operational Agility ................................................................................................................................ 4 Elastic Scalability ................................................................................................................................... 4 Guard the Budget .................................................................................................................................. 4 Cost Savings .......................................................................................................................................... 4 Notifications .......................................................................................................................................... 5 Windows Azure Autoscaling Application Block (WASABi) ............................................................................ 5 Major functionalities of Windows Azure .................................................................................................. 5 Instance Scaling..................................................................................................................................... 5 Throttling .............................................................................................................................................. 5 Notifying................................................................................................................................................ 5 Custom action ....................................................................................................................................... 5 Adding Autoscaling Application Block to Host Application........................................................................... 6 Hosting the Autoscaling Application Block in a Windows Azure Worker Role ............................................. 7 Instantiate and Run the Scaler .................................................................................................................. 7 Import Namespaces .............................................................................................................................. 7 Resolve an instance of Autoscaler class................................................................................................ 7 Edit Autoscaling Application Block Configuration..................................................................................... 8 Author Rule Configuration File ............................................................................................................... 11 Author Service Configuration File ........................................................................................................... 12 Quick Steps to Add and Use Autoscaling Application Block ....................................................................... 12 Windows Azure Compute Resources to Host Autoscaling Application Block............................................. 13
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
Introduction
Cloud computing is the set of technologies and infrastructure capabilities being offered in a service based consumption model. Windows Azure is Microsofts Cloud computing offering to build and deploy applications on a Pay-per-use basis. Cloud computing with Microsoft Windows Azure platform lets the customers to focus on delivering services to their customers rather than managing technology infrastructure. One of the key benefits of using Cloud computing is the ability for on-demand scalability of the applications deployed in Cloud. Dynamic provision for load balancing and scaling can dramatically reduce operational overheads, time, and costs and can improve efficiency of the applications deployed over the Cloud. Microsofts patterns & practices team is providing an Auto Scaling solution for Windows Azure that will provides dynamic provision for auto scaling based on the rules defined by the users for the applications scalability needs and organizational strategy.
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
You can instruct the Auto Scaling service to launch an additional compute instances whenever CPU usage is high for a pre-defined time. You can instruct the Auto Scaling service to terminate few compute instances whenever CPU usage is low for a pre-defined time. You can instruct the Auto Scaling service to terminate few compute instances over the weekend when traffic is expected to be low. You can instruct the Auto Scaling service to launch an additional compute instances over the evening time of week days when traffic is expected to be high. You can instruct the Auto Scaling service to launch an additional compute instances when messages on your applications queue service is very high. You can configure the Auto Scaling service for receiving email notifications whenever compute usage is very high or low.
The above conditions are just few example scenarios, but the Auto Scaling can provide business values to many situations based on the behavior of your applications and the organizational strategy. This can reduce lot of manual tasks involved in load balancing and scaling and can staying on budget. Auto Scaling will help the enterprises to save both time and money and can improve business agility. Auto Scaling is a must have service when organizations are moving their applications onto Cloud.
Operational Agility
Auto Scaling service can reduces lot of manual tasks involved in load balancing and scaling which will enables the overall operational agility and better productivity.
Elastic Scalability
Auto Scaling service can dynamically add compute resources when application usage rises and remove it when usage drops.
Cost Savings
Auto Scaling service can save usage costs of compute resources by terminating underused instances automatically and launching new instances when applications need more compute resources.
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure Notifications
The Auto Scaling service can also use for receiving notifications and alerts about the load situations and health statuses.
Instance Scaling
The Autoscaling Application Block varies the number of role instances in order to accommodate variations in the load on the application. Instance scaling actions can span multiple host services/subscriptions.
Throttling
Instead of spinning off new instances, the block limits or disables certain expensive operations in your application when the load is above certain thresholds.
Notifying
Instead of performing instance scaling or throttling, the user may elect to simply receive notifications about the load situations with no automatic scaling taking place.
Custom action
We can build extensions using the extensibility features provided by Autoscaling Application Block.
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
The NuGet package will add the all necessary assemblies and references to your project that you need to use the Autoscaling Application Block. The NuGet package will also add the XML schema files for the autoscaling rule definitions and autoscaling service information.
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
Import Namespaces
Import the following namespaces to the Worker Role class
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling;
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
public override bool OnStart() { // *** AzureAutoScale-Start *** //Set Max number of concurrent connections ServicePointManager.DefaultConnectionLimit = 12;
DiagnosticMonitorConfiguration dmc = DiagnosticMonitor.GetDefaultInitialC onfiguration(); dmc.Logs.BufferQuotaInMB = 4; dmc.Logs.ScheduledTransferPeriod = TimeSpan.FromSeconds(30); dmc.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose; DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.Conne ctionString", dmc); // *** AzureAutoScale-End *** return base.OnStart(); } }
When you call the Start method of the Autoscaler class, the block will look for rule and service information, and will start to monitor hosted services and will perform the auto scaling based on the rules defined in the rule store.
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
In the Enterprise Library Configuration tool, open the Blocks menu, and then click Add Autoscaling Settings.
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
10
The enterprise library configuration tool allows editing Autoscaling settings, Rule store information and the Service information store. The Rule Store settings contain the storage information about Rules configuration file and the Service Information Store settings contain the storage information about Service configuration file. Typically, if you host the Autoscaling Application Block in a worker role, you will store the data points, rule definitions, and service information in Windows Azure storage.
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
11
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
12
The above rule configuration contains two constraint rules a default rule and a rule for peak business time on every Fridays. The rank specified in the rule configuration is just a priority for each role. The utcOffset value is using to convert the configured local time to UTC time using by the Windows Azure. The reactive rules contain the rules for KPI based on the CPU utilization.
Improving Operational Agility and Efficiency involved in Load Balancing and Scaling using Windows Azure
13
5. Configure the Rule Store settings to specify the storage information of Rules configuration file. 6. Configure the Service Information Store to specify the storage information of Service information configuration file. 7. Add Rules configuration XML file to specify the rules and conditions for scaling. 8. Add Service information XML file to specify Windows Azure subscription and hosted services to monitoring the Autoscaling Application Block.
Conclusion
Windows Azure is Microsofts offering for Cloud computing to help customers to build and deploy applications on a Pay-per-use basis and providing on-demand scalability. This allows the customers to fully focus on their applications rather than managing IT infrastructure. The Windows Azure Autoscaling Application Block lets the Windows Azure customers to take full advantage of scalability offerings provided by Windows Azure. This enables the customers to reduce number of management overheads involved load balancing and scaling which will improve the business agility and can also reduce cost and time.
Links
Windows Azure - http://www.microsoft.com/windowsazure/ Microsoft Patterns & Practice - http://entlib.codeplex.com/