Building high scale, highly available websites in SharePoint 2010


Published on

This session was given at London's SharePoint Evolution Conference by Ben Robb in April 2010.

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Custom code is the single biggest cause of performance problems on SharePoint 2007 deployments. And I doubt that SharePoint 2010 will magically fix that. A badly written web part or server control can cripple a farm, and it is often hard to track down what the cause of a problem is without going up a lot of blind alleys.
  • Building high scale, highly available websites in SharePoint 2010

    1. 1. Building high scale, high availability websites in SharePoint 2010<br />Ben Robb<br />MVP, SharePoint Server<br />CTO, cScape Ltd<br />
    2. 2. Agenda<br />What is “high” and why is it important?<br />How do you test performance?<br />What impacts performance?<br />Reducing server load<br />Reducing page payload<br />Reducing requests to the server<br />High availability<br />
    3. 3. What I’m not covering<br />General best practice for deploying large scale SharePoint implementations<br />Deep dive code examples<br />Detailed test planning<br />Metrics<br />SharePoint 2010 only went to RTM last week…<br />
    4. 4. What is “high”?<br />Not as high as you think<br />Most of the pointers in this session can be used by all deployments<br />Trading scale and availability is sometimes a judgement call<br />Most of the strategy in this session is relevant in any web site - ASP.NET applications, MOSS, SP2010<br />
    5. 5. Why is this important?<br />Speed of response is critical to website success<br />Amazon found that a 100ms increase in page response time led to a 1% drop in sales (Kohavi and Longbotham2007)<br />When the homepage of Google Maps was reduced from 100KB to 70-80KB, traffic went up 10% in the first week, and an additional 25% in the following three weeks (Farber 2006)<br />
    6. 6. Reducing set up and running costs<br />Lower hardware costs<br />Lower software costs<br />Lower maintenance costs<br /> vs.<br />Higher testing and development costs<br />If you don’t do it right first time…<br />
    7. 7. Performance Testing Toolkit<br />Browser Test Tools<br />Fiddler<br />IE Developer Toolbar<br />YSlow<br />Load Test Tools<br />TinyGet<br />Visual Studio Test Edition<br />HP LoadRunner [aka Mercury]<br />External tools<br />SaaS load testers [e.g. Keynote]<br />
    8. 8. Types of performance testing<br />Load testing<br />How does my application perform with the expected number of users?<br />Spike testing<br />How many users do I have when my application fails?<br />Endurance (soak) testing<br />What happens over a long period continuous load?<br />
    9. 9. Goals<br />Set performance goals based on your requirements<br />Concurrency / Throughput<br />Server response times<br />Page weight<br />Develop a test plan<br />What user journeys to test?<br />Benchmark and repeat your tests<br />
    10. 10. Performance Testing<br />
    11. 11. What impacts performance?<br />Workload on the servers in responding to a request<br />The size of the page payload<br />Number of requests to the server<br />
    12. 12. Reduce the workload<br />Server topology<br />Custom code<br />Deployment techniques<br />Caching techniques<br />Offload SSL<br />
    13. 13. Reduce the workloadServertopologies <br />Follow best practice for scalability of SharePoint Farms<br />Switch off unused services in SharePoint and Windows<br />Separate Authoring Farm from Production Farm<br />Set the Content Databases on Production to be Read-Only<br />Use SQL Mirroring to synchronise between the Author and Production Farm<br />
    14. 14. Reduce the workloadTaxonomy and site structure<br />Don’t mix secure and insecure content<br />Caching efficiencies<br />(Also reduces management overhead)<br />
    15. 15. Reduce the workloadManaged code<br />Apply standard .NET best practice<br />Exception handling<br />Defensively code your applications<br />Do not catch exceptions you can’t handle<br />Fail early<br />Clean up in Finally {} blocks<br />Understand how .NET manages objects<br />
    16. 16. Reduce the workloadManaged code<br />SharePoint specific best practice<br />Be careful of what is going on under the hood<br /><ul><li>“list.Items.Count” will hydrate every item…</li></ul>Properly dispose of objects<br />Aggregation / Rollup<br />Use out of the box controls (XsltListView) or if custom code is required use PortalSiteMapProvider or Search<br />Never iterate through collections of strongly typed SharePoint objects<br />
    17. 17. Reduce the workloadDeployment techniques<br />Deploy via Features and Solutions<br />Keep files un-customized<br />Customized pages rely on the safe mode parser<br />
    18. 18. Reduce the workloadCaching techniques<br />Output Caching<br />Use the Anonymous cache profile<br />BLOB caching<br />
    19. 19. Reduce the workloadOffload work to the other servers<br />SSL<br />Resource intensive<br />Should be dealt with by the firewall or dedicated hardware<br />Custom Service Applications<br />Allows you to offload expensive workloads to other servers<br />
    20. 20. Reducing the server workload<br />
    21. 21. Reducing page payload<br />ViewState<br />Valid XHTML<br />No inline style<br />Lazy load JavaScript files<br />IIS Compression<br />
    22. 22. Page payload<br />
    23. 23. Reducing the page payload<br />
    24. 24. Reducing the number of requests<br />Consolidate files together during the build<br />Minimize the number of JS and CSS files you are deploying – either manually or in MSBuild scripts<br />Use AJAX to reduce the number of complete page roundtrips<br />Remove unneeded OOTB scripts and CSS<br />Use CSS Sprites<br /><ul><li>Split asset requests off to another FQDN</li></ul>Use Content Delivery Networks where possible<br />
    25. 25. Reducing page requests<br />
    26. 26. CDNs<br />Content Delivery Networks cache content around the world<br />Reduces latency<br />Scales to millions of users<br />Not applicable for personalised content<br />May require changes to applications to take full advantage<br />
    27. 27. Uses for CDNs<br />Host streaming media<br />“Smooth HD” from Microsoft & Akamai<br />Host standard frameworks - jQuery, AJAX<br /><br />Host complete sites<br />Uses Akamai or similar<br />
    28. 28. High availabilityFarm topology<br />Apply general availability best practice<br />Move other services off your web front end servers<br />Consider the usage patterns of your web application – mostly read-only in WCM scenarios<br />Make sure you have no single points of failure<br />Use the Service Application load balancing to provide services<br />CDNs also help here<br />
    29. 29. High availabilityImprovements in SP 2010<br />Sandboxed solutions<br />Allow system administrators control over resources used by custom code<br />Small performance hit for running in a separate thread<br />Health Analyser and server monitoring<br />Catch issues earlier<br />Patch management<br />
    30. 30. Key takeaways<br />Reduce your server workload<br />Reduce the size of the page payload<br />Reduce the number of requests to the server<br />Measure, benchmark, test and retest your performance<br />
    31. 31. Thank you for attending!<br />Any questions?<br />Contact me:<br /><br /><br />@benrobb<br />