building high scale, highly available websites in sharepoint 2010

31
Building high scale, high availability websites in SharePoint 2010 Ben Robb MVP, SharePoint Server CTO, cScape Ltd

Upload: ben-robb

Post on 21-May-2015

2.800 views

Category:

Technology


0 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Building high scale, highly available websites in SharePoint 2010

Building high scale, high availability websites in SharePoint

2010Ben Robb

MVP, SharePoint Server

CTO, cScape Ltd

Page 2: Building high scale, highly available websites in SharePoint 2010

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

Page 3: Building high scale, highly available websites in SharePoint 2010

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…

Page 4: Building high scale, highly available websites in SharePoint 2010

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

Page 5: Building high scale, highly available websites in SharePoint 2010

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)

Page 6: Building high scale, highly available websites in SharePoint 2010

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…

Page 7: Building high scale, highly available websites in SharePoint 2010

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]

Page 8: Building high scale, highly available websites in SharePoint 2010

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?

Page 9: Building high scale, highly available websites in SharePoint 2010

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

Page 10: Building high scale, highly available websites in SharePoint 2010

Demo

PERFORMANCE TESTING

Page 11: Building high scale, highly available websites in SharePoint 2010

What impacts performance?

Workload on the servers in responding to a request

The size of the page payload Number of requests to the server

Page 12: Building high scale, highly available websites in SharePoint 2010

Reduce the workload

Server topology Custom code Deployment techniques Caching techniques Offload SSL

Page 13: Building high scale, highly available websites in SharePoint 2010

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

Page 14: Building high scale, highly available websites in SharePoint 2010

Reduce the workloadTaxonomy and site structure

Don’t mix secure and insecure content Caching efficiencies (Also reduces management overhead)

Page 15: Building high scale, highly available websites in SharePoint 2010

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

Page 16: Building high scale, highly available websites in SharePoint 2010

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

Page 17: Building high scale, highly available websites in SharePoint 2010

Reduce the workloadDeployment techniques

Deploy via Features and Solutions Keep files un-customized

Customized pages rely on the safe mode parser

Page 18: Building high scale, highly available websites in SharePoint 2010

Reduce the workloadCaching techniques

Output Caching Use the Anonymous cache profile

BLOB caching

Page 19: Building high scale, highly available websites in SharePoint 2010

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

Page 20: Building high scale, highly available websites in SharePoint 2010

Demo

REDUCING THE SERVER WORKLOAD

Page 21: Building high scale, highly available websites in SharePoint 2010

Reducing page payload

ViewState Valid XHTML

No inline style Lazy load JavaScript files IIS Compression

Page 22: Building high scale, highly available websites in SharePoint 2010

Page payloadChart Title

50%

0%

6%5%

29%

2% 8%

Chart Title

application/x-javascriptimage/x-icontext/cssimage/jpegimage/pngtext/htmlimage/gif

Page 23: Building high scale, highly available websites in SharePoint 2010

Demo

REDUCING THE PAGE PAYLOAD

Page 24: Building high scale, highly available websites in SharePoint 2010

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

Page 25: Building high scale, highly available websites in SharePoint 2010

Demo

REDUCING PAGE REQUESTS

Page 26: Building high scale, highly available websites in SharePoint 2010

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

Page 27: Building high scale, highly available websites in SharePoint 2010

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

Page 28: Building high scale, highly available websites in SharePoint 2010

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

Page 29: Building high scale, highly available websites in SharePoint 2010

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

Page 30: Building high scale, highly available websites in SharePoint 2010

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

Page 31: Building high scale, highly available websites in SharePoint 2010

Thank you for attending!

Any questions?

Contact me: [email protected] http://sharepointtales.wordpress.com @benrobb