1 / 50

Best Practices for Building Your Website for Scale with Microsoft SharePoint 2010

OSP333. Best Practices for Building Your Website for Scale with Microsoft SharePoint 2010 . Spencer Harbar Microsoft Corporation. Best Practices for Capacity Management. Capacity Planning. Workload In this case, read-heavy WCM environment Dataset

hal
Download Presentation

Best Practices for Building Your Website for Scale with Microsoft SharePoint 2010

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OSP333 Best Practices for Building Your Website for Scale with Microsoft SharePoint 2010 Spencer Harbar Microsoft Corporation

  2. Best Practices for Capacity Management

  3. Capacity Planning • Workload • In this case, read-heavy WCM environment • Dataset • How much content? How often will you update it? • Multilingual? • Performance & availability targets • For a read-heavy WCM site, maximize throughput (RPS) • Effective use of caching helps tremendously

  4. The case for caching # of Front-end Web Servers

  5. Where’s the bottleneck? Front-end web server(s) • CPU • Memory • Disk I/O • Disk space xn Application server(s) • Disk I/O • Memory • CPU xn Database servers • Database locks • Disk I/O • CPU • Memory • Disk space

  6. Web server CPU utilization should be the bottleneck • CPU • Memory • Disk I/O • Disk space Front-end web server(s) xn Application server(s) • Disk I/O • Memory • CPU xn Database servers • Database locks • Disk I/O • CPU • Memory • Disk space

  7. Key Scale Tools: The Caches Output cache Compiled pages Object cache SPQuery result sets BLOB Cache Static files Web server memory Web server disk

  8. Output cache • How to set it up • Site Settings  Site Collection Cache Profiles • Site Settings  Site Collection Output Cache • Cache profiles give you granularity • Anonymous vs. authenticated • Different caching behavior for certain page layouts • “Vary By” parameters

  9. Recommended cache configuration • For site visitors • Public Internet cache profile • Don’t enable “check for changes” • Minimize vary by parameters • For authors/admins (authenticated users) • Consider not caching

  10. Tip: Making sure the output cache is working… Enable debug info in Site Collection Output Cache Settings • Viewing the source for pages shows the cache timestamp • Monitoring DB traffic: Can’t use “Developer Dashboard” (because it gets cached with the page). • Use SQL Profiler instead

  11. Monitoring the output cache • A cache miss is more expensive than rendering a page without caching • Lots of cache trimming? Tweak duration or scale up web servers

  12. What maxing out web server CPU looks like

  13. A classical debate to be fresh …or fast?

  14. Fast and fresh

  15. ASP.Net Post-Cache Substitution • Sometimes you want completely “dynamic” content elements on an otherwise cached page.

  16. ASP.NetPost-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.

  17. 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”)

  18. Configuring the Object Cache (Cont’d) • Key Configuration Decisions

  19. Configuring the Object Cache (Cont’d) • Configure the two “super” accounts used by the Object Cache via PowerShell: $wa = Get-SPWebApplication -Identity "<WebApplication>" $wa.Properties["portalsuperuseraccount"] = "<SuperUser>" $wa.Properties["portalsuperreaderaccount"] = "<SuperReader>" $wa.Update()

  20. What happens when you don’t use the Object Cache…

  21. What happens when you don’t use the Object Cache… • 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.

  22. Using the Object Cache from client-side code • To build a client-side solution (Silverlight/AJAX/Flash/etc.) that queries SharePoint data: • Write a web service that wraps the Object Cache and executes cache queries • Make sure your solution calls your web service. Do NOT use the SharePoint client object model… it is un-cached.

  23. 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? • Less rendering work for SharePoint • Fewer bytes-over-the-wire for users visiting your site • Support for HTTP range requests for media files

  24. 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

  25. 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 jQueryor Modernizr, load them from the ASP.Net AJAX CDN

  26. IIS Compression • We STRONGLY recommend enabling static compression.

  27. Content Deployment – Recap of Authoring Models • Author-in-place • Content Deployment • Authors and visitors share the same site collection. • Variable distributions of read and write operations throughout a given day. • Specialized environments for authoring and viewing. • Scheduled deployment jobs “replay” operations from Authoring to Production.

  28. Content Deployment • Authoring Farm • Production Farm Content DB Content DB Content Deployment Crawl Crawl SSP Proxy Search Index Search Index SSP Proxy EMM Term Store

  29. Content Deployment – Value Proposition Content Deployment is great for customers who: • Have a business/regulatory/legal requirement that no user can have contributor permissions on their production site. • 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.

  30. Who shouldn’t use Content Deployment today? • I want to review/stage everything before it’s “in production” • High availability (including geo-rep)/disaster recovery • Site relaunch/redesign • I want to schedule the load from write operations

  31. Content Deployment Best Practice #1: SQL Server Enterprise Edition & Snapshots Content Deployment + SQL Server Enterprise = No export failures due to on-going authoring activity.

  32. Content Deployment Best Practice #1: SQL 2008 Enterprise Edition & Snapshots (Cont’d) Central Administration  Manage Content Deployment Paths and Jobs  <Your Job>

  33. 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: • Admin activates solution on SOURCE of Content Deployment • Objects are added to the Content DB • Content Deployment will then do the following on the TARGET: • Deploy the content objects to the target Content DB • Automatically activate the custom solution (FAIL)

  34. 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 }

  35. 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" />

  36. Variations – Best Practices At Scale • 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. • Consider On-Demand Page Propagation: • It can save a LOT of unnecessary copy operations.

  37. Variations – On-Demand Page Propagation • Automatic • Manual • On-demand

  38. Content Deployment and Variations Production SPSite Authoring SPSite / Root SPWeb / Root SPWeb /en-us Source SPWeb /en-us Source SPWeb /Pages/ /Pages/ /fr-fr Target SPWeb /fr-fr Target SPWeb Content Deployment /Pages/ /Pages/

  39. 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();

  40. Variationsfixuptool • What is it for? • PRIME migration of content into the source label • Repairing broken Relationships (major assumptions) • Generating reports of the Relationships List • No longer: • Breaking down Create Hierarchies into more discrete units (possible OOB) • Causing Create Hierarchies to run in the timer service (OOB)

  41. Call to Action: Don’t let this be you…

  42. In Review: Session Objectives and Takeaways Best Practices backed up with testing and customer stories • How to make best use of cachingfor dynamic sites • When to use Content Deployment and alternatives • How features interact with Content Deployment • Strategies for using Variations • What the “Variationsfixuptool” is for and when to use it

  43. Related Content • 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

  44. The Business Collaboration Platform for the Enterprise and the Internet The Business Collaboration Platform for the Enterprise & the Internet • Deliver the Best Productivity Experience • Cut Costs with a Unified Infrastructure • Rapidly Respond to Business Needs The capabilities of SharePoint 2010 provide a powerful business collaboration platform

  45. Project and SharePoint Better Together Manage Resources Improve efficiency and save money by better managing work and allocation of resources Maximize Portfolio Returns Make informed investment decisions and effectively communicate results across a portfolio of projects Keep Teams ProductiveSave time and improve project results by centralizing team collaboration on deliverables and tasks Improve SharePoint ROI Effectively manage requests to maximize the ROI of your SharePoint environment • www.sharepoint.microsoft.com • www.microsoft.com/project

  46. Resources Learning TechNet • Connect. Share. Discuss. • Microsoft Certification & Training Resources http://europe.msteched.com www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers • http://microsoft.com/technet http://microsoft.com/msdn

  47. Evaluations Submit your evals online http://europe.msteched.com/sessions

  48. © 2012 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. 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.

More Related