Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
How to scale up, out or down in Windows Azure<br />Juan De Abreu<br />VP -Delivery Director<br />jdeabreu@getcs.com<br />
#CSwebinar<br />
Outline<br />Scalability<br />Achieving linear scale<br />Scale Up vs. Scale Out in Windows Azure<br />Choosing VM Sizes<b...
A Primer on Scale<br />Scalability is the ability to add capacity to a computing system to allow it to process more work<b...
A Primer On Scalability<br />Vertical Scale Up<br />Add more resources to a single computation unit i.e. Buy a bigger box<...
Vertical vs. Horizontal<br />For small scenarios scale up is cheaper<br />Code ‘just works’<br />For larger scenarios scal...
Roughly Linear Scalei.e. Additional throughput achieved by each additional unit remains constant<br />Throughput<br />Non ...
Scalability != Performance<br />Often you will sacrifice raw speed for scalability<br />For example; ASP.NET session state...
Achieving Linear Scale Out<br />Reduce or Eliminate Shared Resources<br />Minimize reliance on transactions or transaction...
Units of Scale<br />Consolidation of Roles provides more redundancy for same <br />Create as many roles as you need ‘knobs...
VM Size in Windows Azure<br />Windows Azure<br />Supports Various VM Sizes<br />~800mb/s NIC shared across machine<br />Se...
Remember:<br />If it doesn’t run faster on multiple cores on your desktop … It’s not going to run faster on multiple cores...
Choosing Your VM Size<br />Don’t just throw big VMs at every problem<br />Scale out architectures have natural parallelism...
Caching<br />#CSwebinar<br />
Caching<br />Caching can improve both performance and scalability<br />Moving data closer to the consumer (Web/Worker) imp...
Caching Scenario: Website UI Images<br />Website UI Images<br />Largely static data<br />Included in every page<br />Goal:...
Caching Scenario: RSS Feeds<br />Regular RSS Feed<br />Data delivered from database/storage<br />Large content payload>1mb...
Caching Strategies<br />Client Side Caching<br />Static Content Generation<br />#CSwebinar<br />
Client Side Caching<br />Client<br />Web Roles<br />WorkerRoles<br />BLOBs<br />Queues<br />Tables<br />SQL Azure<br />#CS...
Client Caching - ETags<br />ETag == Soft Caching<br />Header added on HTTP Response<br />ETag: “ABCDEFG”<br />Client does ...
Client Caching - ETags<br />Benefits<br />Prevents client downloading un-necessary data<br />Out of the box support for si...
Client Caching – Cache-Control<br />Cache-Control: max-age  == Hard Caching<br />Header added on HTTP Response<br />Cache-...
Client Caching – Cache-Control<br />Benefits<br />Prevents un-necessary HTTP requests<br />Prevents un-necessary downloads...
Static Content Generation<br />Web Roles<br />WorkerRoles<br />BLOBs<br />Queues<br />Tables<br />SQL Azure<br />#CSwebina...
Static Content Generation<br />Generate Content Periodically in Worker Role<br />Can spin up workers just for generation<b...
Static Content Generation<br />Benefits<br />Reduce load on web roles<br />Potentially reduce load on data tier<br />Respo...
A Better RSS Feed?<br />Build standard RSS Feed in Web Role<br />Generate content dynamically from storage<br />Serialize ...
BLOBs vs. Compute Instances<br />BLOB Storage<br />Disk Based<br />15c/GB/Month<br />1c/10,000 requests<br />Compute Insta...
Elastic Scale Out<br />#CSwebinar<br />
Elastic Cloud Workflow Patterns     <br />“Growing Fast“  <br />“On and Off “  <br />Inactivity<br />Period <br />Compute ...
Dealing with Variable Load<br />Dealing with variable load takes two forms<br />Maintaining excess capacity or headroom<br...
Faster availability
Async work pattern can provide buffer</li></ul>Adding/Removing additional capacity<br /><ul><li>Takes time to spin up
Requires management- human or automated
Upcoming SlideShare
Loading in …5
×

How to scale up, out or down in Windows Azure - Webinar

5,679 views

Published on

Webinar presented on Jan 26th 2011 by Juan De Abreu.
Learn how to achieve:

• Scalability linear scale, scale up vs. scale out, choose VM sizes
• Storage Cache
• Elasticity, scale out, scale back and automation of scaling

Intended for:CIOs, CTOs, IT Managers, IT Developers, Lead Developers

Published in: Technology
  • Be the first to comment

How to scale up, out or down in Windows Azure - Webinar

  1. 1. How to scale up, out or down in Windows Azure<br />Juan De Abreu<br />VP -Delivery Director<br />jdeabreu@getcs.com<br />
  2. 2. #CSwebinar<br />
  3. 3. Outline<br />Scalability<br />Achieving linear scale<br />Scale Up vs. Scale Out in Windows Azure<br />Choosing VM Sizes<br />Caching<br />Approaches to caching<br />Cache storage<br />Elasticity<br />Scale out, scale back<br />Automation of scaling<br />#CSwebinar<br />
  4. 4. A Primer on Scale<br />Scalability is the ability to add capacity to a computing system to allow it to process more work<br />#CSwebinar<br />
  5. 5. A Primer On Scalability<br />Vertical Scale Up<br />Add more resources to a single computation unit i.e. Buy a bigger box<br />Move a workload to a computation unit with more resourcese.g. Windows Azure Storage moving a partition.<br />Horizontal Scale Out<br />Adding additional computation units and having them act in concert<br />Splitting workload across multiple computation units<br />#CSwebinar<br />
  6. 6. Vertical vs. Horizontal<br />For small scenarios scale up is cheaper<br />Code ‘just works’<br />For larger scenarios scale out only solution<br />Massive diseconomies of scale<br />1 x 64 Way Server >>>$$$ 64 x 1 Way Servers.<br />Shared resource contention becomes a problem<br />Scale out offers promise of linear, infinite scale<br />#CSwebinar<br />
  7. 7. Roughly Linear Scalei.e. Additional throughput achieved by each additional unit remains constant<br />Throughput<br />Non Linear Scalei.e. Additional throughput achieved by each additional unit decreases as more are added<br />Computation Units<br />
  8. 8. Scalability != Performance<br />Often you will sacrifice raw speed for scalability<br />For example; ASP.NET session state<br />In Process ASP.NET Session State<br />SQL Server ASP.NET Session State<br />#CSwebinar<br />
  9. 9. Achieving Linear Scale Out<br />Reduce or Eliminate Shared Resources<br />Minimize reliance on transactions or transactional type behaviour<br />Homogenous, Stateless computation nodes<br />We can then use simple work distribution methodsLoad balancers, queue distribution<br />Less reliance on expensive hardware H/A<br />
  10. 10. Units of Scale<br />Consolidation of Roles provides more redundancy for same <br />Create as many roles as you need ‘knobs’ to adjust scale<br />Web Driven Role<br />WCF Role<br />Web Site Role’<br />Cache Build Role<br />Clean Up Role<br />Loss of an instance results in just 25% capacity loss in web site.<br />Loss of an instance results in 50% capacity loss in web site.<br />Queue Drive <br />Role<br />#CSwebinar<br />
  11. 11. VM Size in Windows Azure<br />Windows Azure<br />Supports Various VM Sizes<br />~800mb/s NIC shared across machine<br />Set in Service Definition (*.csdef).All instances of role will be equi-sized<br /><WorkerRole name=“myRole" vmsize="ExtraLarge"><br />#CSwebinar<br />
  12. 12. Remember:<br />If it doesn’t run faster on multiple cores on your desktop … It’s not going to run faster on multiple cores in the cloud!<br />#CSwebinar<br />
  13. 13. Choosing Your VM Size<br />Don’t just throw big VMs at every problem<br />Scale out architectures have natural parallelism<br />Test various configurations under load<br />Some scenarios will benefit from more cores<br />Where moving data >$ parallel overhead<br />E.g. Video processing<br />Stateful services<br />Database server requiring full network bandwidth<br />#CSwebinar<br />
  14. 14. Caching<br />#CSwebinar<br />
  15. 15. Caching<br />Caching can improve both performance and scalability<br />Moving data closer to the consumer (Web/Worker) improves performance.<br />Reducing load on the hard to scale data tier<br />Caching Is The Easiest Way To Add Performance and Scalability To Your Application<br />In Windows Azure: Caching Will Save You Money!<br />#CSwebinar<br />
  16. 16. Caching Scenario: Website UI Images<br />Website UI Images<br />Largely static data<br />Included in every page<br />Goal: A Better UI<br />Serve content once<br />Avoid round trip unless content changes<br />Minimise traffic over the wire<br />Fewer storage transactions<br />Lower load on web roles<br />#CSwebinar<br />
  17. 17. Caching Scenario: RSS Feeds<br />Regular RSS Feed<br />Data delivered from database/storage<br />Large content payload>1mb<br />Data changes irregularly<br />Cost determined by client voracity<br />Goal: A Better RSS Feed<br />Minimise traffic over the wire<br />Fewer storage transactions<br />Less hits on database<br />#CSwebinar<br />
  18. 18. Caching Strategies<br />Client Side Caching<br />Static Content Generation<br />#CSwebinar<br />
  19. 19. Client Side Caching<br />Client<br />Web Roles<br />WorkerRoles<br />BLOBs<br />Queues<br />Tables<br />SQL Azure<br />#CSwebinar<br />
  20. 20. Client Caching - ETags<br />ETag == Soft Caching<br />Header added on HTTP Response<br />ETag: “ABCDEFG”<br />Client does conditional HTTP GET<br />If-None-Match: “ABCDEFG”<br />Returns content if ETag no longer matches<br />Implemented natively by Windows Azure Storage<br />Supports client side caching<br />Also used for optimistic concurrency control<br />#CSwebinar<br />
  21. 21. Client Caching - ETags<br />Benefits<br />Prevents client downloading un-necessary data<br />Out of the box support for simple ‘static content’ scenarios.<br />Problems<br />Still requires round trip to server<br />May require execution of server side code to re-create ETag before checking<br />string etag = Request.Headers["If-None-Match"];<br />if(String.Compare(etag, GetLastBlogPostIDAzTable()) == 0) {<br /> Response.StatusCode = 412;<br /> return;<br />}<br />#CSwebinar<br />
  22. 22. Client Caching – Cache-Control<br />Cache-Control: max-age == Hard Caching<br />Header added on HTTP Response<br />Cache-Control: max-age=2592000<br />Client may cache file without further request for 30 days<br />Client will not re-check on every request<br />Very useful for static files<br />header_logo.png<br />Used to determine TTL on CDN edge nodes<br />Set this on Blob using<br />x-ms-blob-cache-control <br />#CSwebinar<br />
  23. 23. Client Caching – Cache-Control<br />Benefits<br />Prevents un-necessary HTTP requests<br />Prevents un-necessary downloads<br />Problems<br />What if files do change in the 30 days?<br />Windows Azure Technique:<br />Put static files in Blob storage use Cache-Control + URL FlippingSimple randomization == simple but no versioning<br />Container level flipping == simple but more expensive<br />Snapshot level flipping == more complex but lower cost<br /><img src=http://*.blob.*/Container/header_logo.png ?random=<rnd>/><br /><img src=http://*.blob.*/Containerv1.0/header_logo.png /><br /><img src=http://*.blob.*/Containerv2.0/header_logo.png /><br /><img src=http://*.blob.*/Container/header_logo.png ?snapshot=<DT1>/><br /><img src=http://*.blob.*/Container/header_logo.png ?snapshot=<DT2>/><br />
  24. 24. Static Content Generation<br />Web Roles<br />WorkerRoles<br />BLOBs<br />Queues<br />Tables<br />SQL Azure<br />#CSwebinar<br />
  25. 25. Static Content Generation<br />Generate Content Periodically in Worker Role<br />Can spin up workers just for generation<br />Generate as triggered async operation<br />Content May Be<br />Full pages<br />Resources (CSS Sprites, PDF/XPS, Images etc…)<br />Content fragments<br />Push static content into Blob storage<br />Serve direct out of Blob storage<br />May also be able to use persistent local storage<br />#CSwebinar<br />
  26. 26. Static Content Generation<br />Benefits<br />Reduce load on web roles<br />Potentially reduce load on data tier<br />Response times improved<br />Can combine with Cache-Control and ETags<br />Problems<br />Need to deal with stale data<br />Manage/Refresh<br />Ignore<br />#CSwebinar<br />
  27. 27. A Better RSS Feed?<br />Build standard RSS Feed in Web Role<br />Generate content dynamically from storage<br />Serialize as RSS using Feed Formatters<br />Place on obfuscated (hidden) URL<br />Build a worker role to poll hidden RSS feed<br />Retrieve RSS content at certain intervals or on event<br />Push content into a Blob if changed<br />Serve RSS to users from Blob storage<br />Take advantage of E-Tags<br />Zero load on database or RSS tables to serve content<br />#CSwebinar<br />
  28. 28. BLOBs vs. Compute Instances<br />BLOB Storage<br />Disk Based<br />15c/GB/Month<br />1c/10,000 requests<br />Compute Instances<br />RAM and Disk Based<br />12c/hrper 1GB RAMper 250GB disk<br />Dedicated compute cache roles must serve at least 120,000 cache requests per hour to be cheaper than Windows Azure storage<br />Outside USA and Europe: use CDN for caching due to much lower bandwidth costs<br />#CSwebinar<br />
  29. 29. Elastic Scale Out<br />#CSwebinar<br />
  30. 30. Elastic Cloud Workflow Patterns <br />“Growing Fast“ <br />“On and Off “ <br />Inactivity<br />Period <br />Compute <br />Compute <br />Average Usage<br />Usage<br />Average<br />Time <br />Time <br />On & off workloads (e.g. batch job)<br />Over provisioned capacity is wasted <br />Time to market can be cumbersome <br />Successful services needs to grow/scale <br />Keeping up w/ growth is big IT challenge <br />Cannot provision hardware fast enough<br />“Unpredictable Bursting“ <br />“Predictable Bursting“ <br />Compute <br />Compute <br />Average Usage <br />Average Usage <br />Time <br />Time <br />Unexpected/unplanned peak in demand <br />Sudden spike impacts performance <br />Can’t over provision for extreme cases <br />Services with micro seasonality trends <br />Peaks due to periodic increased demand<br />IT complexity and wasted capacity <br />#CSwebinar<br />
  31. 31. Dealing with Variable Load<br />Dealing with variable load takes two forms<br />Maintaining excess capacity or headroom<br /><ul><li>Costs: paying for unused capacity
  32. 32. Faster availability
  33. 33. Async work pattern can provide buffer</li></ul>Adding/Removing additional capacity<br /><ul><li>Takes time to spin up
  34. 34. Requires management- human or automated
  35. 35. Pre-emptive or metric driven</li></ul>#CSwebinar<br />
  36. 36. Head Room in Windows Azure<br />Web Roles<br />Run additional web roles<br />Handle additional load before performance degrades<br />Worker Roles<br />If possible just buffer into queues<br />Will be driven by tolerable level of latency<br />Start additional roles only if queues not clearing<br />Use generic workers to pool resources<br />#CSwebinar<br />
  37. 37. Head Room in Windows Azure Services<br />Windows Azure Storage<br />Storage nodes serve many partitions<br />Partition served by a single storage node<br />Fabric can move to a different storage node<br />Opaque to the Windows Azure customer<br />SQL Azure<br />Non-deterministic throttle gives little indication<br />Run extra instances – requires DB sharding<br />#CSwebinar<br />
  38. 38. Adding Capacity in Windows Azure<br />Web Roles/Worker Roles<br />Enable more instances (API or *.config)<br />Editing instance count in config leaves existing instances running<br />Change to using larger VMs- will require redeploy. <br />Windows Azure Storage<br />Opaque to user<br />Partition aggressively<br />Can ‘heat up’ a partition to encourage scale up<br />#CSwebinar<br />
  39. 39. Adding Capacity in SQL Azure<br />SQL Azure<br />Add more databases (more partitions)<br />Very difficult to achieve mid-stream<br />Requires moving hot data<br />Maintaining consistency across multiple DBs without DTC<br />Will depend on partitioning strategy<br />#CSwebinar<br />
  40. 40. Rule Based Scaling<br />Use Service Management and Diagnostics APIs<br />On/Off and Predictable Bursting<br />Time based rules<br />Unpredictable demand and Fast Growth<br />Monitor metrics and react accordingly<br />Action+/- instance count<br />Deploy new service<br />Increase queues<br />Send notifications<br />Monitor InputsHistorical Data<br />TransactionsPerf CountersBusiness KPIs<br />Evaluate Biz Rules<br />Latency too high/lowHow much $ spent<br />Are we at limit<br />Predicted load<br />Diagnostics & Management APIs<br />#CSwebinar<br />
  41. 41. Monitor metrics<br />Primary metrics (actual work done)<br />Requests per Second<br />Queue messages processed / interval<br />Secondary metrics<br />CPU Utilization<br />Queue length<br />Response time<br />Derivative metrics<br />Rate of change of queue lengthUse ‘historical’ data to help predict requirements<br />#CSwebinar<br />
  42. 42. Gathering Metrics<br />Use Microsoft.WindowsAzure.Diagnostics.*<br />Capture various metrics via Management API<br />Diagnostics Infrastructure Logs<br />Event Logs<br />Performance Counters<br />IIS Logs<br />May need to smooth/average some measures<br />Remember the cost of gathering data<br />Both performance and financial costs<br />Would you use Perf Counters 24/7 on a production system? http://technet.microsoft.com/en-us/library/cc938553.aspx<br />#CSwebinar<br />
  43. 43. Evaluating Business Rules<br />Are requests taking too long?<br />Do I have too many jobs in my queue?<br />How much money have I spent this month?<br />Could write these into code.<br />Could build some sort of rules engine.<br />Could use the WF rules engine.<br />#CSwebinar<br />
  44. 44. Take Action<br />Add/Remove Instances<br />Use Service Management API<br />Change role size<br />Requires change to *.csdef<br />Most suited to Worker Roles<br />Send notifications<br />Email<br />IM<br />Manage momentum<br />Be careful not to overshoot<br />#CSwebinar<br />
  45. 45. Summary<br />Designing for multiple instances provides<br />Scale out<br />Availability<br />Elasticity options<br />Caching should be a key component of any Windows Azure application<br />Various options for variable load<br />Spare capacity<br />Scale Out/Back<br />Automation possible<br />#CSwebinar<br />
  46. 46. Resources<br />www.msteched.com/Australia<br />Sessions On-Demand & Community<br />www.microsoft.com/australia/learning<br />Microsoft Certification & Training Resources<br />http:// technet.microsoft.com/en-au<br />Resources for IT Professionals<br />http://msdn.microsoft.com/en-au<br />Resources for Developers<br />#CSwebinar<br />
  47. 47. Thanks! How can we help?<br />Juan De Abreu<br />VP -Delivery Director<br />jdeabreu@getcs.com<br />blog.getcs.com<br />#CSwebinar<br />© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.<br />The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.<br />

×