Orlando DNN Usergroup Pres 12/06/11

812 views

Published on

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

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
812
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Orlando DNN Usergroup Pres 12/06/11

  1. 1. GeoCaching Minification For Crying Out Loud JUST MAKE IT FAST!Blah-Blah-Blah Optimization Optimizing Your Website
  2. 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 There‟s a plethora of options but beware! Topics
  3. 3. DisclaimerIf you break your website, it‟s your own fault! Don‟t blame me, I didn‟t do it.Remember to backup first and roll back if necessary.Get the slide deck here: http://slideshare.net/jesscoburn/
  4. 4. Recommended Tools • YSlow – plugin for Firefox and Chrome that analyzes sites based on 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 is pretty kick ass (yes! that‟s an acceptable technical term, I can say it!). http://code.google.com/chrome/devtools/ Both tools are similar but provide slightly different information. I recommend both.Etags MinifyCDNs Tools Sprites
  5. 5. Before We Begin: Backup IISBackup IIS: %windir%system32inetsrvappcmd add backup “rutroh”Restore IIS Backup: %windir%system32inetsrvappcmd restore backup “rutroh” Backup Is Your Friend
  6. 6. Example Modern Websites
  7. 7. Example Output: YSlow
  8. 8. Example Output: Chrome Dev Tools
  9. 9. Removing ETags• Entity Tags (Etags) are hashes that determine if a file that‟s currently cached has changed. These are server unique and will hurt when you‟re 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 at the site level or can be set at the server level in the applicationHost.config<rewrite> <outboundRules> <rule name="Remove ETag"> <match serverVariable="RESPONSE_ETag" pattern=".+" /> <action type="Rewrite" value="" /> </rule> </outboundRules></rewrite> Hiya!
  10. 10. Before & AfterBEFOREAFTER
  11. 11. Enable Browser & Proxy Caching• Add Expires Headers on static content - Images, CSS, JavaScript, etc.• Set “Cache-Control: Public” on static content Quick Tricks for Speed
  12. 12. Enable Browser & Proxy Caching• In IIS: Select folders with static content and set HTTP Response Headers Screenshots Rule!
  13. 13. Enable Browser & Proxy Caching Ohh Arrows
  14. 14. Enable Browser & Proxy Caching Enabling Cache-Control: Public Header for Static Content • This needs to be set in your web.config using the code snippet: <configuration> <system.webServer> <staticContent> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" /> </staticContent> </system.webServer> </configuration>NOTE: Remember to clear browser cache if you don‟t see changes in resultsafter making these changes. These tools also don‟t like short periods of time (7days, so you may need to set it further out) Cache for Cash!
  15. 15. Enable Browser & Proxy CachingImportant Notes:• Try to keep static content in separate folders from other content so you can adjust 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, resources Look up! Important Notes!
  16. 16. Enable Browser & Proxy CachingNOTE: You might not be able to get everything but don‟t worry. Not Perfect but faster!
  17. 17. Enable Gzip CompressionThere‟s mixed guidance on whether to leverage DNN‟s compression or IIS‟scompression. My recommendation is to use IIS‟s compression, I believe it‟s 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 (you‟ll gain no benefit) IIS Is Your Friend
  18. 18. Enable Gzip Compression
  19. 19. Enable Gzip CompressionDoh! Ran out of ink!!
  20. 20. Minify CSS & JavaScriptThis removes empty space, comments, etc to reduce overall size of requests. Thiscan be done within the FireFox Yslow component under tools Minification (say it, its cool)
  21. 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 images Enable Caching
  22. 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! I’m Back!!!
  23. 23. CDNs & Cookieless ServersTwo items that come up frequently are CDN‟s & Cookieless Server so let‟s justtouch on them quickly. C’mon Is there an easier way?
  24. 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. 25. Other IIS Tweaks• Dedicated App Pools: Always place sites in dedicated application pools with unique users. This is for security, 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. Definitely use Integrated Pipeline Mode.• Authentication providers – disable those that you don‟t 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. 26. 5 Minutes of SQL Kung FuTO SAVE YOU 5 DAYS OF SQL GRIEF! Zzzz
  27. 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.• DON’T 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 it‟s 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. 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 go with 64 bit OS and 64 bit version of SQL.• Separate Services: Always run dedicated web, dedicated SQL, don‟t skimp like the discount hosts and put both on the same 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: DON’T USE WEAK PASSWORDS: password, username, etc.
  29. 29. App Specific DNN PERFORMANCE TIPSDNN Rules!
  30. 30. General DNN Guidance• Dedicated Server / Cloud Server : Use memory caching when possible. Be sure to disable purge module 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 don‟t need but keep in mind you‟ll not have this information.• Database Logs will fill fast! Be careful here, use simple.
  31. 31. Content Staging, Upgrades WEBPI & WEBMATRIXTime Savers!
  32. 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 to date with the latest builds.• Can be extended: You can create custom feeds for the App Gallery and use Web PI to install your own applications and/or environments even.
  33. 33. Why WebMatrixThree Key Problems• Upgrades: SUCK! You never know what‟s not going to work!• Design Tweaks: Its not good to tweak on the live server when you have visitors.• Installing New Modules: You don‟t know what‟s going to break.Cool WebMatrix Features• Same Environment: You run the same feature rich version of IIS but in user mode so it shuts down when 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 without breaking your production environment.
  34. 34. Now Let’s Talk The Cloud Web Hosting != The Cloud
  35. 35. Classic HostingDedicated Hosting Shared 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 the reside on a singleclosets and computers are machine.bigger)Pay Attention Kurt!
  36. 36. Second Generation Hosting VPS Servers & Distributed Shared Virtualization Hosting One physical server broken Shared hosting spread out out into isolated OS across 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. 37. Cloud Hosting Cloud Servers Cloud Sites • Highly Available • Shared Hosting • Fault Tolerant infrastructure that‟s built • Instantly Scale up on 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. 38. What’s Next?
  39. 39. Questions? Comments? We are happy to help you! www.appliedi.net / www.awesome.net 6401 Congress Ave, Suite 200 Boca Raton, FL 33487 (855) 2.THE.CLOUD Get The Deck: slideshare.net/jesscoburn

×