Sitecore Performance Tips
 

Sitecore Performance Tips

on

  • 3,971 views

Sitecore Performance Tips for Visitor Engagement - Tips to Improve Sitecore 6.5/6.6 Performance for Visitor Engagement

Sitecore Performance Tips for Visitor Engagement - Tips to Improve Sitecore 6.5/6.6 Performance for Visitor Engagement

Statistics

Views

Total Views
3,971
Views on SlideShare
3,936
Embed Views
35

Actions

Likes
2
Downloads
61
Comments
0

4 Embeds 35

http://www.intrateam.dk 17
https://twitter.com 9
http://www.linkedin.com 8
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Sitecore Performance Tips Sitecore Performance Tips Presentation Transcript

  • Sitecore Performance Tips for Visitor Engagement Tips to Improve Sitecore 6.5/6.6 Performance August 2, 2013 1
  • Sitecore Enterprise Web CMS • Popular .NET Web Content Management System for mid-to-large organizations • Provides friendly tools for non-technical Content Authors and Marketers • Can be customized and extended to meet almost any conceivable business need 2
  • Why Performance is Important Faster web sites create a better user experience • Higher performing web sites display more quickly • Google uses page load speed as a metric in rankings • Mobile users may be using sketchy connections • Improving performance reduces bounce rates • Some users leave if a site hasn't loaded in 4 seconds • Users hit back and click the next link in the search results • Higher performing web sites get better results • Higher visitor engagement • Higher visitor retention • Higher visitor conversion rates 3
  • Sitecore Performance Factors Hardware Resources Config Settings Content Hierarchy Coding Practices Page Weight Site Traffic 4
  • Issues that Impact Performance Resource issues that have a negative impact • The hardware is not adequate or there is a bottleneck • The network bandwidth is not adequate for the load Configuration issues that have a negative impact • Pages use too many HTTP requests for components • The site is not configured properly for performance Development issues that have a negative impact • The structure of the web site is non-optimum • Coding issues like using Codebehind instead of CodeFile • Causes frequent recompiles when sublayouts are updated 5
  • Use a High Performance System Use dedicated servers for Sitecore and for SQL • Use your best hardware for SQL Server • Use servers that provide adequate resources • At least 12GB physical memory • At least 2.2GHz quad core processor Use a good Windows server OS to host the site • Use an x64 server operating system architecture • Use later operating system versions over earlier ones 6 CMS CDS SQL
  • Set System Settings for Speed Configure system settings for performance • Set processor scheduling to ‘background services’ • Set visual effects to ‘Adjust for best performance’ • Set the size of the paging file, not system managed • Configure hyperthreading in BIOS when using a VM • Disable the screen saver • Disable Windows services that are not required • Schedule backups and antivirus scans for off-hours • Set the Power Plan to high performance 7
  • Configure Disks for Performance Use high speed disks • Use disks with serial interfaces, such as SAS or SATA • Use hardware RAID 1 or RAID 10; avoid RAID 5 Configure disk settings for performance • Do not enable software RAID or dynamic disks • Configure each disk for write caching in Windows • Regularly defragment any fragmented disks 8 RAID1 RAID 1 RAID10 RAID 10 RAID5 RAID 5 
  • Configure NICs for Performance Configure your network for performance • Use 1 GB network cards or faster & matching cabling • One NIC for visitor traffic • Separate NIC on same network for administration • Separate NIC on different network for database traffic • Use a dedicated private network for IIS <–> DB traffic • Use network cards with hardware data compression Configure network adapter settings for speed • Set the Link Speed to duplex instead of auto 9
  • Optimize Sitecore for Live Sites Optimize Sitecore live sites to run efficiently • Tune Sitecore caches so they are sized properly • Optimize Sitecore media for fast loading • Troubleshoot slow running Sitecore pipelines • Update the Search API to the latest supported version Avoid things that cause Sitecore to run slowly • Do not publish items with validation errors • Do not create huge branches in the content hierarchy • Do not set ‘compilation debug = true’ on live sites • Compilation of aspx and ascx files are not done in batches • Assemblies are compiled for debugging, not performance 10
  • Optimize Sitecore for UI Tools Optimize Sitecore CMS tools to run efficiently • Perform Sitecore maintenance tasks regularly • Search indexes should be re-indexed • Link database should be rebuilt • Sitecore databases should be cleaned up • Manage Sitecore items for performance • Ensure items contain less than 100 immediate children • Ensure items don’t have more than 15 numeric versions • Minimize the use of rich text fields & list fields in items • Manage fields for performance • Use Multiline text fields instead of Rich Text if possible • Don’t use Sitecore query for List fields with many items 11
  • Optimize Layouts for Page Loads Optimize Sitecore layouts for performance • Place stylesheets in HEAD section of Sitecore layouts • This allows page rendering to be done in order • Combine CSS into one file to reduce requests • Place JavaScript at the bottom of Sitecore layouts • JavaScript scripts block parallel downloads • Combine JavaScript into one file to reduce requests • Use Expire Headers so CSS/scripts become cacheable • Use Entity Tags to validate items in the browser cache 12
  • Optimize Code for Performance JetBrains Resharper • Checks code for errors or if it can be improved • C#, ASP.NET, MVC, JavaScript, HTML, and CSS • Locates code smells that indicate a deeper problem • Available at http://www.jetbrains.com/resharper/ ANTs Performance Profiler • Profiles ASP.NET Webforms and MVC • Call tree shows performance data for every method • Shows most expensive methods, queries and requests http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/ 13
  • Fiddler and neXpert Tools Fiddler • A free web debugging proxy for any browser • Useful for testing web site performance • HTTP Caching • Compression • Bottlenecks • Available from http://fiddler2.com/ neXpert • Performance analysis plugin for Fiddler from Microsoft • Helps identify common web performance issues http://www.microsoft.com/en-us/download/details.aspx?id=11729 14
  • Optimize Site Settings for Speed Optimize IIS for performance • Use IIS 7.0 or higher • Stop and disable any unused or unneeded sites Configure IIS site settings for performance • Enable HTTP Keep-Alive so HTTP connection is reused • Compress transfers to speed page load times • Move other services (AD, DNS, FTP) to other servers • Enable both static and dynamic content compression • Configure a content expires header for the site • Set Caching.CacheViewState to false in web.config • ViewState is usually only needed on pages with forms 15
  • Optimize App Pool Settings in IIS Configure IIS app pool settings for performance • A separate application pool for each web site • Managed pipeline mode set to Integrated • .NET framework set to v4.0 • Maximum processes assigned to the pool set as 1 • Enable 32-bit applications set to false • Delete System.Data.SQLite.dll from bin folder if error Avoid changing most advanced app pool defaults 16
  • Optimize SQL Database Settings Configure SQL server settings for performance • Install SQL Server on a dedicated database server • Use x64 SQL Server 2008 R2 or later • Set Boost SQL Server processor priority to true Configure database settings for performance • Set concurrent connections to 0 (unlimited) • Schedule SQL Server backups for off hours • Rebuild the SQL Server indexes regularly • Database indexes become fragmented over time • Heavily fragmented indexes can decrease performance • Create a maintenance plan for databases 17
  • Optimize Page Load Times Optimize page load times on browsers • Reduce # components to make fewer HTTP requests • Combine multiple files/scripts into one file/script • Minimize the use of redirects and DNS lookups • Avoid query strings in the URL of static resources • Avoid HTTP 404 (Not Found) errors • Use multiple geo-dispersed servers or a CDN • Use percentage and relative measures instead of pixel • Good measures are em, ex, bolder, larger and thick • Enables browsers to adapt content to fit the display 18
  • Optimize JavaScript for Page Loads Optimize JavaScript to improve page load times • Use external JavaScript instead of inline JavaScript • Combine JavaScript into one file to reduce requests • Minify JavaScript to remove unnecessary characters • Spaces, tabs and other white space characters • Inline comments • Identify and remove duplicate JavaScript scripts • Place JavaScript at the bottom of Sitecore layouts • JavaScript scripts block parallel downloads 19
  • Optimize AJAX for Page Loads Optimize AJAX to improve page load times • Use GET instead of POST when using XMLHttpRequest • GET sends the headers and the data together • POST implements this in two steps instead • You cannot use GET on IE when the URL length > 2 KB • Make AJAX responses cacheable to optimize them 20
  • Optimize CSS for Page Loads Optimize CSS to improve page load times • Place stylesheets in HEAD section of Sitecore layouts • Use external CSS files so files are cached by browser • Use @charset to set character encoding • Avoid using @import as it can delay page loads • Combine CSS into one file to reduce requests • Implement object-oriented CSS to use inheritance • Minify CSS files to remove unnecessary characters • Spaces, tabs and comments 21
  • Avoid CSS Expressions Using CSS Expressions can degrade performance • Expressions can dynamically set CSS properties • Supported in Internet Explorer Version 5 and later • Frequent evaluations of expressions can occur • When the page is rendered and resized • When the page is scrolled • When the user moves the mouse over the page 22
  • Optimize Images for Page Loads Optimize image sizes to minimize response times • Use a graphic optimizer to reduce the size of graphics • Radical Image Optimization Tool (RIOT) • Compress images to transmit images efficiently • Use progressive jpegs to optimize jpeg loading • Resize images on the server instead of on the client • Use an ashx handler to resize images on the server • Download images that are already the right size • Avoid setting HTML image element width and height 23
  • Guidelines for Using Sprites Use CSS sprites to optimize image load times • Combining images into fewer files can reduce latency • Sprite images that load together on the same page • Sprite GIF and PNG images first as they are lossless • Sprite small images to reduce the requests overhead • Sprite cacheable images • Combine images with the same 256 color palette • Use spriting services to make it easier to build sprites • Reduce the amount of empty space in sprited images 24
  • Optimize Cookies for Page Loads Optimize cookies to improve user response time • Keep cookie sizes small to minimize response times • Eliminate unnecessary cookies • Set cookies for a domain so sub-domains are not affected • Create a subdomain and locate static components there • Servers ignore cookies sent with static image requests • These cookies generate unnecessary network traffic • Use cookie-free requests to request static components • Make the cookie for the server's root small to get favicon • Set an earlier Expires date to remove a cookie sooner 25
  • Optimize Renderings for Page Loads Review rendering times on page loads • Open the Sitecore Page Editor in Debug Mode • Display a web page that loads slowly • Scroll down until the Sitecore Profile is displayed • Review the Hot Spots – Most Time Taken items • Check for renderings with long times in Own column • Update the renderings that are slowing down the page 26
  • Optimize Pipelines for Performance Review pipeline durations to identify slow ones • Install the Pipeline Performance Monitor tool • Unzip ParTech-Pipelines-PerformanceMonitor.zip • Copy ParTech.Pipelines.dll to site’s bin folder • Copy PerformanceMonitor.config to App_Config/Include • Reload web site and click a few links • Review performance.<date>.txt file in /Data/logs • Check httpRequestBegin pipeline times for slow requests • Check renderField pipeline times for slow renderings • Rename PerformanceMonitor.config to disable it http://marketplace.sitecore.net/en/Modules/Pipeline_Performance_Monitor.aspx http://www.partechit.nl/nl/blog/2013/03/monitor-the-duration-of-all-pipelines 27
  • Review Sitecore Logs for Issues Server Issues • Delays between HTTP request and HTTP response • Sitecore is having difficulty processing the response Network Issues • Long HTTP response times • Network is causing delays when downloading Other Issues • Check for long delays between individual log entries 28
  • Use Load Testing for Scaling Site Load Testing helps ensure a system will scale • Anticipates performance with increased traffic loads • Creates simulated server loads expected on live site • A series of test cases are used during the testing • Best to monitor on both the server and client sides Web Performance allows web-based load testing • Load Tester LITE is provided at no cost • Load Tester PRO can be rented or permanent license • Amazon has rental fees for cloud-based load engines • Available at http://www.webperformance.com/ 29
  • Sitecore Shared Source Pipeline Performance Monitor module • Adds generic processor that logs pipeline durations Sitecore Stager module • Used to partially clear Sitecore caches on Live sites • Useful in web farm environments with heavy loads Sitecore TaskManager module • Windows Task Manager and Performance Monitor • A web-based tool to monitor background processes • Indexing and Scheduled Tasks • Publishing All are available from http://marketplace.sitecore.net 30
  • GTmetrix Performance Tool GTmetrix analyzes site performance metrics • Uses Google Page Speed and Yahoo! YSlow • Results for each analysis are shown in separate tabs • Uses 10 geo-dispersed servers to simulate latency • No registration required – results displayed in seconds • Available at http://gtmetrix.com/ 31
  • PageSpeed Insights Tool Google Developer’s PageSpeed Insights tool • Analyzes the content of a designated web page • Generates suggestions to make the page faster • Integrated with Google Analytics • PageSpeed Score ranges from 0 to 100 points • A higher score is better • Scores greater than 85 show pages are performing well https://developers.google.com/speed/pagespeed/insights 32
  • YSlow Page Performance Tool Browser add-on that analyzes site performance • Uses Yahoo’s rules for high performance web pages • Summarizes the page's components • Displays statistics about the page • Suggests ways to improve page performance Supports many popular browsers • Google Chrome • Mozilla Firefox • Opera • Apple Safari Available at http://developer.yahoo.com/yslow/ 33
  • Additional Site Analysis Tools There are many popular online analysis tools • Pingdom • http://tools.pingdom.com/ • Port 80 Tools • http://www.port80software.com/support/p80tools.asp • Web Page Test • http://www.webpagetest.org/ 34
  • Web Page Performance Test Site that grades performance factors for a URL • Time to First Byte shows server responsiveness • HTTP Keep-Alive shows if HTTP connection is reused • Compressed Transfers helps speed page load times • Compressed Images help transmit images efficiently • Progressive Jpegs optimizes loading of jpeg images • Cache Static Content optimizes JS and CSS file access • Effective Use of CDN tests Content Delivery Network 35
  • In Summary Faster web sites create a better user experience • Use dedicated servers for Sitecore and for SQL • Tune Sitecore caches so they are sized properly • Place stylesheets in HEAD section of Sitecore layouts • Use external CSS files so files are cached by browser • Perform Sitecore maintenance tasks regularly • Review pipeline durations to identify slow ones • Optimize Sitecore images so they load faster • Reduce # components to make fewer HTTP requests • GTmetrix combines PageSpeed Insights and YSlow 36
  • Caveat Emptor There are many ways to manage Sitecore performance • Skilled developers can provide other solutions • Review your performance needs with your Sitecore partner • Review proposed changes with all stakeholders • Implement new configurations on a test system first This presentation is intended to be academic • To enhance public knowledge of performance issues • To promote better understanding of Sitecore performance Author cannot guarantee accuracy or fitness for your site • Author makes no representations or warranties • Author disclaims any liability if you act on this information 37
  • Bibliography Google Developers – Make the Web Faster IEInternals Best Practice: Get your HEAD in order Partech - Monitor the duration of all pipelines Performance Matters – Progressive JPEGs FTW! Yahoo Developer Network – Exceptional Performance Download slide presentation to view URLs 38
  • More Topics from Sitecore Craig Adding Context to Sitecore Content (Tagging) http://www.slideshare.net/cwnelson/tagging-content-in-sitecore Creating Web 2.0 Sitecore Sites http://www.slideshare.net/cwnelson/interactive-users3 How to Avoid Shooting Yourself in the SEO http://www.slideshare.net/cwnelson/sitecore-seo-tips Sitecore 7 – New Features for Users http://www.slideshare.net/cwnelson/sitecore-7-new-features Supporting Mobile Users on Sitecore Sites http://www.slideshare.net/cwnelson/supporting-mobile-users- on-sitecore-sites 39
  • Get Help with your Sitecore Site Invite Sitecore Craig to connect with you on LinkedIn • http://www.linkedin.com/in/sitecorecraig Add Sitecore Craig to your Circles on Google Plus • https://plus.google.com/114214657038667808289 Follow Sitecore Craig on Twitter • https://twitter.com/TheInsideCorner Contact Craig Directly • Craig Nelson - Certified Developer and Sitecore Partner • cwnelson[at]theinsidecorner.com • Mobile - 707.319.7446 Visit Craig’s Sitecore Hobby Site • http://www.theinsidecorner.com 40
  • Thankyoufor taking the time to viewthis presentationon SitecorePerformanceTipsfor VisitorEngagement Pleaseshare withothers and add a commentif youthinkit is useful Thanks! -Craig August 2, 2013 41