1 / 28

Performance Troubleshooting EPiServer CMS Web Sites

Performance Troubleshooting EPiServer CMS Web Sites . Steve Celius – EPiServer Geek. The Different Approaches to Performance. This presentation focuses on troubleshooting existing sites with performance problems Finding the cause and what you can do about it

macon
Download Presentation

Performance Troubleshooting EPiServer CMS Web Sites

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. Performance Troubleshooting EPiServer CMS Web Sites Steve Celius – EPiServer Geek

  2. The Different Approaches to Performance • This presentation focuses on troubleshooting existing sites with performance problems • Finding the cause and what you can do about it • The tools you need, and the common causes • Performance is much much more • Clientside (everything not in your aspx) can be 80% of the download time (when you’re not having server trouble) • I’ll cover this the next time 

  3. The cost of fixing performance problems Thanks to Stuart Tuppert

  4. Finding the slow parts of your site • Analyse IIS Logs • Check time_taken, # requests per hour / min (find the peaks) • Check for errors (404 / 500 status) • LogParser & Visual Log Parser • Find the most requested pages • Find errors and long running requests • Easier with Visual LogParser • Use Fiddler • Performance Monitor • Lots of information on the net • Check cpu, req/s and req. queue

  5. Common Performance Problems

  6. The Large List Problem • Large collections of pages will kill performance • Understanding the cache is important • GetPage / GetChildren gets copies of PageData objects • Memory and CPU intense (lots of allocations and deallocations) • Dynamic Properties – are they really neccessary? • Pages with large strings (MainBody) is also a problem • News archives will slowly kill your site • Edit mode, expanding the tree loads two levels

  7. Key Points • The devil is in the details • You don’t TRULY know until you have profiled • Things changes with content • What does not hurt you today might hurt you tomorrow • Make sure you optimize the important things

  8. Easy Fix Fixing it! • Split up page lists with more then 250 pages into subtrees • Why 250? Practical reasons for editors • Use ”Date Containers” (/News/2007/June/My-news-article) • Moving pages using code is easy • You don’t even need to recompile (no code behind file neccessary). See ArchiveBuilder.aspx • If there are many pages, it will take some time • Cache the list • Move Dynamic Properties to the Start Page • This problem has less impact in CMS 5

  9. FindPagesWithCriteria (FPWC) The most resource intensive operation in EPiServer Very useful, and most sites need it It will search the database, returning all pages that match the criterias ”With great power comes great responsibility”

  10. Medium Fix Fixing it! • Use log4net to detect FPWC calls • Log all FPWC calls to one file, with page id and search ref • Limit the use of FPWC • Always think of alternative solutions • Limit the count of returned pages. The database call is not the problem, working with a large resultset is • Cache what you can cache • Enter EPiCode Cache Framework...

  11. Medium Fix EPiCode Cache Framework for EPiServer 4 • All sites will have some complex and/or heavy queries (not only FPWC) • You should recognize them when you write the code • Prevent these queries to run too often, cache the result • Designed for low impact on existing code • Download from: • www.coderesort.com/p/epicode/wiki/CacheFramework

  12. Easy Fix Use output caching Configurable, turn on in web.config Will cache the html output from your pages Can give you extreme performance Whole cache is invalidated on page publishing Not available for logged in users and POST ”VaryBy” – don’t vary by browser if you do not have to /3GB in boot.ini (?) It won’t fix your problems though

  13. Beware of what you cannot see • RSS Feeds in particular • Long lists, requested often • Check the IIS log file • Use the cache framework • Bots, Crawlers and Spiders • They might fill our output cache • Will visit the ”uninteresting” pages, like the sitemap and news archive. Pages you hope no one visits

  14. Expensive Fix Scale out • Buy more hardware • Load balance on several servers • Especially if the load is the problem • Requires cache invalidation and file sync • Session state (are you using it?) • State Server or SQL Server

  15. Expensive Fix Migrate to EPiServer CMS 5 • You will need to rewrite some of the code • The Migration Tool helps with data migration • This is another presentation altogether • See Marek Blotny’s excellent blog post on EPiServer 5 vs. EPiServer 4.61 • CMS 5 scales much better

  16. Important Tools Fiddler JetBrainsDotTrace WebLoad / Jmeter / WAPT Load Testing log4net Trace Diagnostics IIS Diagnostics ASP.NET Viewstate Helper Performance Viewer (Windows) LogParser & Visual Log Parser IIS Traffic Monitor

  17. Discount 15% b4zLrhD/g23bNieHrY8oV6EIezUiCzad Special offer to all EPiServer Developer Summit 2008 attendees Extended trial period (10  30 days) Offer lasts for 30 days – from now! Read more, download evaluation and order on:http://www.jetbrains.com/profiler Eval and Coupon code:

  18. Misc...

  19. Release Mode • Compile the site in Release Mode (in VS) • <compilation debug=”false” /> in web.config • This will give you ~10% performance gain • ASP.NET will not time out with debug = true • Just as important as the performance gain • WebResources.axd scripts can be cached • Site will use less memory

  20. Enterprise Gotcha • Same source code, many different web sites • One place to deploy code • One config file to update • But... • Config changes will restart all sites • This is heavy lifting! • Logging with log4net is a pain • All sites uses same config, with file locking, first site to start ”wins”. Without locking, log file is a mess • One change affects all sites, needs recompiling

  21. Enterprise Gotcha, contd. • Use deployment scripts to copy files to all sites • With delays to allow recompilation and startup peaks • This also goes for web.config

  22. IIS Settings • Log more • Review the IIS log settings. Turn on most log settings • Remember ”time-taken” • Process Recycling – dont rely on it • It will only help on memory or resource leaks, temporarily • More often used on .NET 1.0/1.1 sites than 2.0 and up • Web Gardens • No, no and no! It can actually hurt performance

  23. Minimize Viewstate Think Green - Save Bandwidth www.binaryfortress.com/aspnet-viewstate-helper

  24. Links Performance Tuning and Optimization of EPiServer CMS (Fredrik Haglund) EPiServer 5 vs. EPiServer 4.61 part I - GetPage()(Marek Blotny) The challenges of a high traffic site with EPiServer(Adam Najmanowicz) Performance Pitfalls in EPiServer (Mats Hellström) The Output Cache - When and Why(Daniel van den Tempel) Caching Custom Data in EPiServer EPiServer Labs

  25. Medium Fix Per Request Cache • Don’t do expensive operations more than once in a request • Example: • Checking if the current page is in a given structure • Refactor into utililty methods • Keep the impact on existing code low • Store in HttpContext.Current.Items • Request bound, thread safe

  26. Tool IIS Traffic Monitor Analyses IIS log files on the fly Simple and quick to use Uses Log Parser 2.2 http://niknak.org/software/IIsTrafficMonitor

  27. Use Fiddler to see real traffic • Server performance is important, but don’t neglect the client side performance • Check the Yahoo Performance Blog (and YSlow) • Percieved performance is also important! • Make sure the clients cache effiently

More Related