If you didn’t attend the PDC session The Business of Windows Azure: What you should know about Windows Azure Platform pricing and SLAs I would recommend you to watch it, it really helps to understand the pricing and license model.
Additionally it also helps to understand the value of Cloud computing and being more precisely Azure.
Linked with my previous post Auto-scaling in Azure, I wanted to talk about the most common workload patterns.
On and Off pattern
Growing fast
Unpredictable bursting
Predictable bursting
Identifying your service workload pattern helps you to maximize the compute capacity utilization and reducing TCO.
As I described in the post Auto-scaling in Azure you can dynamically grow or decrease your service compute capacity.So you could schedule the computing capacity of your service according to the workload pattern.
A really complete example has been published on Windows Azure Dynamic Scaling Sample talking about this topic.
If you are still interested on knowing how this requirement can be “manually” implemented,continue reading this post,otherwise I would recommend you to visit the Windows Azure Dynamic Scaling Sample
Combining the strengthens of the Windows Azure Diagnostics API and the Service Management API makes really easy to implement your own logic for auto-scaling your Azure Services.
In this post I will show you how I have implemented a PoC for auto-scaling an Azure Solution and the different options that you have for implementing a similar solution.
1. Solution architecture
The solution components are :
The following diagram illustrates the solution architecture :
It would also have been possible to host the Controller Service in a traditional on premise service.The following diagram illustrates that option:
2. Using the Diagnostics API for reading performance counters
With the Diagnostics API you can :
The following table outlines the traces and counters that can be activeted and where are stored .
Diagnostic Data Type
Default Configuration
Stored in WA Storage as
Windows Azure Logs
Enabled and generating logs locally
Contains logs from the diagnostic infrastructure, which help the user troubleshoot issues with the diagnostic monitoring system itself.
Table
WADInfrastructureLogsTable
Diagnostic Monitor Logs
Contains the logs generated by your service using standard .NET Tracing APIs.
WADLogsTable
Performance Counters
Not Enabled
WADPerformanceCountersTable
Windows Event Logs
Application Crash Dumps
Blob
wad-crash-dumps
IIS Logs
Failed Request Logs
Enabled
wad-iis-failedreqlogfiles
Arbitrary Logs
For detailed information about implementing diagnostics in Azure go to the link Implementing Windows Azure Diagnostics
3. Scaling an Azure Service
For scaling an Azure service, you must consume the Service Management API.
Before being able to consume the API, you should generate a self-signed certificate for authenticating the service requests.You can show how this can be achieved in the following link Authenticating Service Management Requests.
After that, you have the following options for consuming the service management API and scaling the service:
When updating the service configuration,the key it’s to modify the Instances count param of the service configuration.For instance, this XML represents Financial Service configuration contained in the .csfg file
<Role name="GRC.BasicFinancialService"> <Instances count="1" /> <ConfigurationSettings> <Setting name="DiagnosticsConnectionString" value="UseDevelopmentStorage=true" /> </ConfigurationSettings> </Role>
If you want to scale the service using a the power shell cmdlets here you have an example :
string scaleScript="Add-PSSnapin AzureManagementToolsSnapIn "+
"Get-HostedService $serviceName -Certificate $cert -SubscriptionId $subId | "+
"Get-Deployment -Slot Production | " +
"Set-DeploymentConfiguration {$_.RolesConfiguration[$roleName].InstancesCount+=1}" ;
I hope that this post has helped you to see the wide set of options that you have for implementing diagnostics in your Azure Service.
I will upload the PoC I have used as soon as it is fully tested.
Continuing with the last post Update and upgrade domains, I wanted to give more details about the choices in Azure for upgrading a service.
First of all, we can upgrade the service from two places:
Additionally, Windows Azure provides two mechanisms for upgrading your service:
You can do Automatic In-Place upgrades to automatically upgrades all domains or Manual for upgrading one domain at one time.
For more details about the upgrade points, see Upgrading a Service