Download presentation
Presentation is loading. Please wait.
Published byOctavia Harper Modified over 9 years ago
2
Best Practices for Building Your Website for Scale with Microsoft SharePoint 2010 Josh Stickler Program Manager Microsoft Corporation OSP333
4
Best Practices for Capacity Management Capacity Planning Architect for Scale Pilot & Test Deploy Monitor & Validate
6
The case for caching # of Front-end Web Servers
7
Front-end web server(s) x n CPU Memory Disk I/O Disk space Application server(s) x n Disk I/O Memory CPU Database servers Database locks Disk I/O CPU Memory Disk space
8
Front-end web server(s) x n CPU Memory Disk I/O Disk space Application server(s) x n Disk I/O Memory CPU Database servers Database locks Disk I/O CPU Memory Disk space
9
Key Scale Tools: The Caches Output cache Compiled pages Object cache SPQuery result sets BLOB Cache Static files Web server memory Web server disk
12
Tip: Making sure the output cache is working…
14
What maxing out web server CPU looks like
15
to be fresh …or fast?
17
ASP.Net Post-Cache Substitution Sometimes you want completely “dynamic” content elements on an otherwise cached page.
18
ASP.Net Post-Cache Substitution You can achieve exactly this behavior, by writing a custom control that inherits from the System.Web.UI.WebControls.Substitution class. The rest of the page will be output-cached, but this control will be called to render on every request. Key consideration: Your control will be run on EVERY request… plan carefully.
19
SharePoint Object Cache What is the Object Cache? An in-memory cache of results to “Cross-List Queries” against your SharePoint site. Used to cache the results of queries that can span lists and sites within a Site Collection. But also good for caching results of queries within a single list. You’re probably already using it! (And it’s “always on”)
20
Configuring the Object Cache (Cont’d) Key Configuration Decisions Parameter NameDecisionGeneral Principle Object Cache SizeHow big do you want the Object Cache to be? Bigger is better (make sure you have enough RAM) Cache ChangesDo I want a purely time-based cache, or should every request check to see if cache is still valid? Checking for changes == more work per cached request Results MultiplierShould we cache more results than the user asked for? Only useful in scenarios where different users have different permissions…
21
Configuring the Object Cache (Cont’d) Configure the two “super” accounts used by the Object Cache via PowerShell: $wa = Get-SPWebApplication -Identity " " $wa.Properties["portalsuperuseraccount"] = " " $wa.Properties["portalsuperreaderaccount"] = " " $wa.Update() Account NamePermissions it should have SuperUserFull Control User Policy for the Web Application SuperReaderFull Read User Policy for the Web Application
22
What happens when you don’t use the Object Cache…
23
What went wrong? The hero control (which was implemented as a Sandboxed Solution) was using the non-cached SharePoint API, instead of the cached API. The site was launched, and as soon as it got real load, the Sandboxed Solution throttling system (correctly) stopped executing the control. Good Bad
24
Using the Object Cache from client-side code To build a client-side solution (Silverlight/AJAX/Flash/etc.) that queries SharePoint data: 1. Write a web service that wraps the Object Cache and executes cache queries 2. Make sure your solution calls your web service. Do NOT use the SharePoint client object model… it is un-cached.
25
SharePoint Disk-based BLOB cache What is it? A cache that stores files on the web-front end’s disk drive. Why should you use it? 1. Less rendering work for SharePoint 2. Fewer bytes-over-the-wire for users visiting your site 3. Support for HTTP range requests for media files
26
Configuring the BLOB cache Edit the following line in web.config: <BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" max-age="86400" enabled=“true"/> Write to a separate drive (GB) more is better (ms) more is better
27
A quick note about CDNs The appeal of CDNs Less load on your server per-user Browsers will load more files in parallel (2 connection per-server limit) Geo-distribution For content (e.g. BLOBs) Resources are effectively “external” URLs and you trade-off CMS goodness For “system” files Easy win: If you’re using jQuery or Modernizr, load them from the ASP.Net AJAX CDNjQuery Modernizrthe ASP.Net AJAX CDN
28
IIS Compression We STRONGLY recommend enabling static compression.
29
Content Deployment – Recap of Authoring Models
30
Content DB EMM Term Store Content Deployment SSP Proxy SSP Proxy Content DB Crawl Search Index Crawl Search Index
31
Content Deployment – Value Proposition Content Deployment is great for customers who: 1. Have a business/regulatory/legal requirement that no user can have contributor permissions on their production site. 2. Will be reviewing/staging ALL content before it goes live. Content Deployment adds LATENCY between when Content is authored/approved & when it goes live. Latency is proportional to the volume of changes since last deployment. And if you have multiple targets, things will be temporarily out of sync.
33
Content Deployment Best Practice #1: SQL Server Enterprise Edition & Snapshots Content Deployment + SQL Server Enterprise = No export failures due to on-going authoring activity.
34
Content Deployment Best Practice #1: SQL 2008 Enterprise Edition & Snapshots (Cont’d) Central Administration Manage Content Deployment Paths and Jobs
35
Content Deployment Best Practice #2: Custom Solutions & Content Deployment Custom Solutions MUST be “aware” of Content Deployment Many custom solutions add/modify Content DB objects (and fail if they can’t add/modify the objects). The pattern we see in many custom solutions: 1. Admin activates solution on SOURCE of Content Deployment 1. Objects are added to the Content DB 2. Content Deployment will then do the following on the TARGET: 1. Deploy the content objects to the target Content DB 2. Automatically activate the custom solution (FAIL)
36
Custom Solutions & Content Deployment How to write Content Deployment-friendly code: using Microsoft.SharePoint.Deployment.SPImportContext; if (SPImportContext.Current.IsRunning) { // You’re running during Content Deployment import, so // Don’t try to re-create items that were // already created on source site collection. } else { // Add/modify Content DB objects }
37
Content Deployment and Caching Cache profiles and settings are deployed, too You override cache profiles in web.config <OutputCacheProfiles useCacheProfileOverrides=“true" varyByHeader="" varyByParam="*" varyByCustom="" varyByRights="true" cacheForEditRights=“true" />
38
Variations – Best Practices At Scale 1. Avoid “Multilingual Afterthought Syndrome” If you think you may need Variations in the future, set up Variations early on. If you do this later, you’ll have to copy a LOT of content from the root web to your source label. 2. Consider On-Demand Page Propagation: It can save a LOT of unnecessary copy operations.
39
Variations – On-Demand Page Propagation Automatic Manual On-demand
40
Authoring SPSite Production SPSite Content Deployment
41
On-Demand Page Propagation: PowerShell Enable On-Demand Page Propagation: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $site = new-object Microsoft.SharePoint.SPSite("http://yourserver/sites/abc") $folder = $site.RootWeb.Lists["Relationships List"].RootFolder $folder.Properties.Add("DisableAutomaticPropagation", "True") $folder.Update();
43
Call to Action: Don’t let this be you…
45
OSP335 - Exploring the Power of Page Layouts in SharePoint 2010 WCM Sites OSP52-HOL - Branding a Microsoft SharePoint 2010 Site from an Existing Web Design OSP04-TLC - Microsoft SharePoint 2010 Demo Station
46
The Business Collaboration Platform for the Enterprise & the Internet The capabilities of SharePoint 2010 provide a powerful business collaboration platform
48
Connect. Share. Discuss. http://northamerica.msteched.com Learning Microsoft Certification & Training Resources www.microsoft.com/learning TechNet Resources for IT Professionals http://microsoft.com/technet Resources for Developers http://microsoft.com/msdn
49
Complete an evaluation on CommNet and enter to win!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.