Your SlideShare is downloading. ×

Sitecore Performance Tips

5,160
views

Published on

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

Published in: Technology

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,160
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
95
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Sitecore Performance Tips for Visitor Engagement Tips to Improve Sitecore 6.5/6.6 Performance August 2, 2013 1
  • 2. 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
  • 3. 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
  • 4. Sitecore Performance Factors Hardware Resources Config Settings Content Hierarchy Coding Practices Site Traffic Page Weight 4
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. 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 RAID 1 RAID 1 RAID 10 RAID 10 RAID 5 RAID   5
  • 9. 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
  • 10. 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
  • 11. 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
  • 12. 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
  • 13. 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
  • 14. 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
  • 15. 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
  • 16. 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
  • 17. 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
  • 18. 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
  • 19. 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
  • 20. 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
  • 21. 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
  • 22. 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
  • 23. 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
  • 24. 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
  • 25. 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
  • 26. 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
  • 27. 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
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. 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
  • 32. 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
  • 33. YSlowPage 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
  • 34. 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
  • 35. 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
  • 36. 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
  • 37. 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
  • 38. More Topics from TIC All Sitecore-related SlideShares from TIC http://www.slideshare.net/cwnelson/presentations Creating Web 2.0 Sitecore Sites http://www.slideshare.net/cwnelson/interactive-users3 How to Assure Success for a New Sitecore Site (full slide deck) http://www.slideshare.net/cwnelson/creating-new-sitecore-sites-full Implementing Routine Sitecore Maintenance http://www.slideshare.net/cwnelson/sitecore-maintenance-tips Performance Tips for Sitecore Mobile Users http://www.slideshare.net/cwnelson/sitecore-mobile-performance-tips Sitecore 7 – New Features for Users http://www.slideshare.net/cwnelson/sitecore-7-new-features Troubleshooting Sitecore Performance http://www.slideshare.net/cwnelson/troubleshooting-sitecore-performance 38
  • 39. The Inside Corner, Inc. • The Inside Corner, Inc. (TIC) is owned by Craig Nelson • TIC is a Sitecore partner & web consultancy • A U.S. point of contact for teams of Sitecore specialists • We create new Sitecore sites & enhance existing ones 39
  • 40. Primary Developer - Craig Nelson • Sitecore Specialist certified for Sitecore 7 • 10 years of system administration experience • 10 years as a Microsoft Certified Trainer • 5 years of ASP.NET web development experience • 4 years of Sitecore development experience • 3 years as a Sitecore technical instructor • Sitecore architecture & configuration expert • Performance & SEO optimization specialist • Workflow configuration specialist 40
  • 41. Get Help with your Sitecore Site Follow TIC on LinkedIn • http://www.linkedin.com/company/the-inside-corner-inc. Add TIC to your Circles on Google Plus • http://google.com/+Theinsidecorner Follow TIC on Twitter • https://twitter.com/TheInsideCorner Contact Craig Directly • Craig Nelson - Certified 7.0 Developer and Sitecore Partner • cwnelson[at]ticdevs.com • Mobile - 707.319.7446 Visit the TIC website • http://ticdevs.com 41
  • 42. 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 42
  • 43. Thank you for taking the time to view this presentation on Sitecore Performance Tips for Visitor Engagement Please share with others and add a comment if you think it is useful Thanks! August 2, 2013 43