AZR 323 a Building Robust Windows Azure Applications
AZR 323 a Building Robust Windows Azure Applications with P&P Guidance @Mahesh. Krishnan Principal Consultant, Readify
What’s covered
Changes in code public class Worker. Role : Role. Entry. Point { private Autoscaler _autoscaler; . . . public override bool On. Start() { _autoscaler = Enterprise. Library. Container. Current. Get. Instance<Autoscaler>(); _autoscaler. Start(); . . . } public override void On. Stop() { _autoscaler. Stop(); . . . } }
<rules xmlns= "http: //schemas. microsoft. com/practices/2011/entlib/autoscaling/rules"> <constraint. Rules> <rule name="Default" rank="1"> <actions> <range min="2" max="6" target="SM. Website"/> </actions> </rule> <rule name="Peak" rank="10"> <timetable start. Time="08: 00" duration="08: 00" utc. Offset="+10: 00" > <!--<weekly days="Monday Tuesday Wednesday Thursday Friday"/>--> <daily/> </timetable> <actions>. . . </actions> </rule> </constraint. Rules> </rules>
<reactive. Rules> <rule name="Scale. Up. On. High. Utilization" rank="15" > <when> <greater operand="CPU" than ="60"/> </when> <actions> <scale target="SM. Website" by="1"/> </actions> </rule> <rule name="Scale. Down. On. Low. Utilization" rank="20" > <when> <less operand="CPU" than ="30"/> </when> <actions> <scale target="SM. Website" by="-1"/> </actions> </rule> </reactive. Rules>
<operands> <performance. Counter alias="CPU" performance. Counter. Name="Processor(_Total)% Processor Time" source="SM. Website" timespan="00: 05: 00" aggregate="Average"/> </operands>
<rule name="Throttling. Rule" rank="50" > <when> <greater operand="CPU" than ="60"/> </when> <actions> <change. Setting setting. Name="Throttle" target="SM. Website" value="true" /> </actions> </rule>
<stablizer> <role. Alias=“SM. Website” scale. Down. Cooldown=“ 00: 10: 00” scale. Up. Cooldown=“ 00: 10: 00” scale. Down. Onlyin. Last. Minutes. Of. Hour=“ 10” scale. Up. Only. In. First. Minutes. Of. Hour=“ 30”> </stablizer>
demo WASABi in action Name Title Group
Transient Errors Handling them using TOPAZ
//Use retry aware connection using (var conn = new Reliable. Sql. Connection (conn. String, retry. Policy)) { conn. Open(); var cmd = conn. Create. Command(); cmd. Command. Text = sql. Stmt; //retry aware Execute. Command int count = cmd. Execute. Scalar(); }
sql. Retry. Policy. Execute. Action(() => { // Invoke a Linq. To. SQL query. }); return sql. Retry. Policy. Execute. Action<IEnumerable<string>>( () => { // Invoke a EF LINQ query return result; });
demo TOPAZ in action Name Title Group
WASABi
TOPAZ
- Slides: 38