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