Notes on Azure Elastic Scaling by Zoiner Tejada. This is again one of these PluralSight courses, where only the sample project is worth the membership to the site. Get it there. Check also: Channel 9 Autoscaling in Windows Azure 2013
Dodging the 503 server busy response
Scale for performance, capacity & availability
Costs of over-allocating (Ideally paying for exactly what is needed)
Scale out/in: adding/removing number of instances
Scale up/down: increasing/decreasing the power of resources
Database can be scaled out by sharding with federations
Elastic Scale: The ability to adjust resources according to demand.
Scaling vs Throttling
Things needed to allow automating scaling
- Build tooling to monitor cloud service's key performance
- Use the Windows Azure Service Management API from your code
- Collect diagnostics
- Maximize clock hour use in scaling decisions
- Send admins notification
- Manage cool down periods between scaling actions
- Metronome: collects kpi data
- Scaler + Stabilizer: manage scale and notifications
- Tracker: log outcome of actions
- Add reference to WASABI library from your project
- Nuget: Autoscaling Application BLock
- Instantiate Autoscaler in code : var autoscaler = EnterpriseLibraryContainer.Current.GetInstance<Autoscaler>(); autoscaler.Start();
- Configure App, Service Information Store and Rules Store
- Deploy and run
Contstraint rules over Reactive rules
Rule with highest integer rank wins
Intelligent scaling action on tie breaking
Scale and/or notifications
WASABi in Azure
makecert -sky exchange -r -n "CN=<CertificateName>" -pe -a sha1 -len 2048 -ss My"<CertificateName>.cer"
via azure portal, settings, mgmt certs, upload
backup .pfx with password
export via mmc, certs snap-in, personal, export
put public and private key on machine running autoscaler
Add WASABi nuget
Add Enterprise Library config nuget
Update app.config (right-click)
point to Rules.xml
point to ServiceInfo.xml
add smtp info
Make sure you save as utf-8 without signature!
Add xsd to schema
ConstraintRules eg. ScaleTargetHost min="2" max="6"
ReactiveRules eg. greaterOrEqual operand="averageCPU" than="30"
Operands eg. alias="averageCPU" performanceCOunterName="..."
eg. PerformaceCounters scheduledTransferPeriod="PT1M"
Pubish Web Role and Run Web Worker Autoscaler
When performance counters, queue length or instance count aren't enough
For use by reactive rules only
eg. Queue msg depth, number of files in blob, business tickets, ...
Extend DataPointsParametersElement using IDataPointsCollector
When adjusting instance count or changing settings isn't enough
eg. change role instance size, scale vm website db storage, send sms messages
Extend ReactiveRuleActionElement using instance of ReactiveRuleAction
Remember to put in your custom namespaces (xmlns="http://myfoo")