39
Optimizing Your Website Getting Better-er Performance From Your DNN Site GeoCaching Minification Optimization Blah-Blah- Blah For Crying Out Loud JUST MAKE IT FAST!

Orlando DNN Usergroup Pres 12/06/11

Embed Size (px)

DESCRIPTION

My Presentation at the Orlando DotNetNuke Users Group (ODUG) on Web Performance tweaks and best practices.

Citation preview

  • 1. GeoCaching MinificationFor Crying Out Loud JUST MAKE IT FAST!Blah-Blah-Blah Optimization Optimizing Your Website

2. Topics Today Identify Issues Tools to help identify placesGoal 1 for improvement Web Server Improving Performance on theGoal 2 Frontend. Database Server Selecting, Sizing,Goal 3 Maintaining your SQL Server. Hosting Options & Next Gen Solutions Goal 4 Theres a plethora of options but beware! Topics 3. DisclaimerIf you break your website, its your own fault! Dont blame me, I didnt do it.Remember to backup first and roll back if necessary.Get the slide deck here: http://slideshare.net/jesscoburn/ 4. Recommended Tools YSlow plugin for Firefox and Chrome that analyzes sites basedon set of rules for high performance web pages by Yahoo.http://developer.yahoo.com/yslow for details Chrome Developer Tools Plugin for Google Chrome this ispretty kick ass (yes! thats an acceptable technical term, I can sayit!). http://code.google.com/chrome/devtools/Both tools are similar but provide slightly different information. Irecommend both.EtagsMinifyCDNs Tools Sprites 5. Before We Begin: Backup IISBackup IIS:%windir%system32inetsrvappcmd add backup rutrohRestore IIS Backup:%windir%system32inetsrvappcmd restore backup rutrohBackup Is Your Friend 6. Example Modern Websites 7. Example Output: YSlow 8. Example Output: Chrome Dev Tools 9. Removing ETags Entity Tags (Etags) are hashes that determine if a file thats currently cached has changed. Theseare server unique and will hurt when youre clustered.http://developer.yahoo.com/blogs/ydn/posts/2007/07/high_performanc_11/ Remove Entity Tags (Etags) This can be accomplished using URL Rewrites in your web.config atthe site level or can be set at the server level in the applicationHost.configHiya! 10. Before & AfterBEFOREAFTER 11. Enable Browser & Proxy Caching Add Expires Headers on static content - Images, CSS, JavaScript, etc. Set Cache-Control: Public on static contentQuick Tricks for Speed 12. Enable Browser & Proxy Caching In IIS: Select folders with static content and set HTTP Response HeadersScreenshots Rule! 13. Enable Browser & Proxy CachingOhh Arrows 14. Enable Browser & Proxy CachingEnabling Cache-Control: Public Header for Static Content This needs to be set in your web.config using the code snippet:NOTE: Remember to clear browser cache if you dont see changes in resultsafter making these changes. These tools also dont like short periods of time (7days, so you may need to set it further out) Cache for Cash! 15. Enable Browser & Proxy CachingImportant Notes: Try to keep static content in separate folders from other content so you canadjust these settings on those folders only. Example:/portals/0/images/image.jpg as opposed to /portals/0/image.jpg Folders I tend to make these changes on include: images, css, javascript,skins, containers, resourcesLook up! Important Notes! 16. Enable Browser & Proxy CachingNOTE: You might not be able to get everything but dont worry.Not Perfect but faster! 17. Enable Gzip CompressionTheres mixed guidance on whether to leverage DNNs compression or IISscompression. My recommendation is to use IISs compression, I believe its lessCPU intensive and will provide better results. Plus you can enable it selectively ifyou wish.Remember: If you enable one, disable the other. No need for two compressionsto run (youll gain no benefit) IIS Is Your Friend 18. Enable Gzip Compression 19. Enable Gzip CompressionDoh! Ran out of ink!! 20. Minify CSS & JavaScriptThis removes empty space, comments, etc to reduce overall size of requests. Thiscan be done within the FireFox Yslow component under toolsMinification (say it, its cool) 21. SMUSH IT!This optimizes your image sizes and within the FireFox tool it will allow you todownload a zip of your images maintaining the file structure so you can easilyreplace your imagesEnable Caching 22. Other TweaksThese two tools provide a large number of tweaks that you can do as a developersuch as: Combining Javascript Combining CSS Removing duplicate CSS & JavascriptDefinitely spend more time here, RTFM, Experiment and remember, backup!Im Back!!! 23. CDNs & Cookieless ServersTwo items that come up frequently are CDNs & Cookieless Server so lets justtouch on them quickly.Cmon Is there an easier way? 24. How to get this automaticallyToday a handful of companies are popping up that provide optimized contentserving they provide content optimization, CDN services and frequently securityservices all rolled in one.Two such companies are: YOTTAA.COM & CloudFlare.com.Yeap! but it costs some coin! 25. Other IIS Tweaks Dedicated App Pools: Always place sites in dedicated application pools with unique users. This is forsecurity, reliability, performance and debugging. Default Documents List default.aspx first. ASP.NET Version: DNN recommendation is use ASP.NET 3.5, we see no issues with 4.0. Definitelyuse Integrated Pipeline Mode. Authentication providers disable those that you dont need enabled for your specific site. Compression Enable IIS Compression, Disable DNN compression. Default settings in IIS7 are fine. Control Panel: If deploying multiple sites, reduces errors and keeps configurations similar. Application Pool memory limits: Be aware of these Application Pool idle timeouts: Enabled? Application Warmup Module: Very cool, not openly available any more, email us. KeepAlive Service: KeepAlive Services? Are they needed? Options? Streamline IIS: Disable unnecessary modules (same holds true for DNN) 26. 5 Minutes of SQL Kung FuTO SAVE YOU 5 DAYS OF SQL GRIEF!Zzzz 27. 5 Minutes to save 5 Days of Headaches Disable Full Transaction Logs for non mission critical sites Know the trade offs Implement daily FULL backup jobs when using Simple transaction mode Could be once a day to every few hours a day. DONT Defrag databases .. Big performance hit in most cases, avoid releasing space. Anticipate database size and if possible create it that size initially.Creating a 2GB database 5MB at a time will mean heavy disk I/O that could have been avoided. DO Defrag SQL Indexes Implement a job to defrag indexes. Weekly is fine for most sites.Fantastic FREE SQL maint. Script: http://ola.hallengren.com SQL *loves* memory and will use it all. This could mean it will take too much from the OS and other resources.Limit this in the SQL properties by setting max server memory. Leave 500MB-1GB for the OS, much more if the server shares roles with other services like web.Default min server memory in most cases is OK. Let SQL manage this. It can be adjusted for memory intensive queries but setting this too high can be more detrimental than not adjusting it at all. Know your SQL performance metrics before its too late. A wealth of knowledge at: http://www.brentozar.com/sql/sql-server-performance-tuning/ Cool all-in-one starter tool for monitoring performance: http://sqlmonitor.codeplex.com 28. 5 Minutes to save 5 Days of Headaches Edition: Avoid SQL Express for production, go with Web edition, its really cheap and full featured. Definitely always gowith 64 bit OS and 64 bit version of SQL. Separate Services: Always run dedicated web, dedicated SQL, dont skimp like the discount hosts and put both on thesame server, performance, reliability and security will suffer! (same goes for AD) SQL DBO: SQL user as DBO is generally ok but remember less is always better. Logging: DNN enemy #1, Database logging. Keep it light. Go with Simple recovery mode. Restrict SQL Connections: They will try to hack your SQL Server. Restrict outside access. Passwords: DONT USE WEAK PASSWORDS: password, username, etc. 29. App Specific DNN PERFORMANCE TIPSDNN Rules! 30. General DNN Guidance Dedicated Server / Cloud Server : Use memory caching when possible. Be sure to disable purgemodule cache and purge output cache scheduled tasks. Scheduled Tasks: Review them, tweak them. Mitchell Sellers shout out. Output Caching: Is good stuff, use it Site Log History: DNN logs everything. Disable it if you dont need but keep in mind youll not havethis information. Database Logs will fill fast! Be careful here, use simple. 31. Content Staging, Upgrades WEBPI & WEBMATRIXTime Savers! 32. WebPIProblems it Solves Common Installs: You can install a recommended IIS configuration with a single click in WebPI. Integrates with App Gallery: Makes installing popular apps like DNN very easy and its always up todate with the latest builds. Can be extended: You can create custom feeds for the App Gallery and use Web PI to install yourown applications and/or environments even. 33. Why WebMatrixThree Key Problems Upgrades: SUCK! You never know whats not going to work! Design Tweaks: Its not good to tweak on the live server when you have visitors. Installing New Modules: You dont know whats going to break.Cool WebMatrix Features Same Environment: You run the same feature rich version of IIS but in user mode so it shuts downwhen WebMatrix shuts down. Advanced Publishing: Able to publish permissions, application settings, database content,everything! Reverse Publishing: Able to pull down your live site and database today and tweak it locally withoutbreaking your production environment. 34. Now Lets Talk The CloudWeb Hosting != The Cloud 35. Classic HostingDedicated HostingShared HostingThis started it all, a This is what most peoplecomputer in a closet at some associate with when theyISP. hear hosting.Today Dedicated Hosting is Generally all servicesstill very similar (except thereside on a singleclosets and computers are machine.bigger)Pay Attention Kurt! 36. Second Generation Hosting VPS Servers & Distributed Shared VirtualizationHosting One physical server brokenShared hosting spread out out into isolated OSacross multiple application instances.specific servers. Still susceptible to the same shortcomings of dedicated hosting and vulnerable to some of the shared hosting issues.Some call this cloud hosting ..They Lie! 37. Cloud Hosting Cloud Servers Cloud Sites Highly Available Shared Hosting Fault Tolerantinfrastructure thats built Instantly Scale upon top of Cloud Servers. Pay only for what you use Load Balanced and only when you need Instantly Scale Out. it.Cloud = Faster, Better, Cheaper! 38. Whats Next? 39. Questions? Comments?We are happy to help you! www.appliedi.net / www.awesome.net6401 Congress Ave, Suite 200 Boca Raton, FL 33487(855) 2.THE.CLOUD Get The Deck: slideshare.net/jesscoburn