How to Troubleshoot Apps for the Modern Connected Worker
Orlando DNN Usergroup Pres 12/06/11
1. GeoCaching Minification
For Crying Out Loud
JUST MAKE IT FAST!
Blah-Blah-Blah Optimization
Optimizing Your Website
2. Topics Today
Identify Issues – Tools to help identify places
Goal 1 for improvement
Web Server – Improving Performance on the
Goal 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. Disclaimer
If 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. 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 Minify
CDNs
Tools Sprites
5. Before We Begin: Backup IIS
Backup IIS:
%windir%system32inetsrvappcmd add backup “rutroh”
Restore IIS Backup:
%windir%system32inetsrvappcmd restore backup “rutroh”
Backup Is Your Friend
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!
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 results
after making these changes. These tools also don‟t like short periods of time (7
days, so you may need to set it further out)
Cache for Cash!
15. Enable Browser & Proxy Caching
Important 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. Enable Browser & Proxy Caching
NOTE: You might not be able to get everything but don‟t worry.
Not Perfect but faster!
17. Enable Gzip Compression
There‟s mixed guidance on whether to leverage DNN‟s compression or IIS‟s
compression. My recommendation is to use IIS‟s compression, I believe it‟s less
CPU intensive and will provide better results. Plus you can enable it selectively if
you wish.
Remember: If you enable one, disable the other. No need for two compressions
to run (you‟ll gain no benefit)
IIS Is Your Friend
20. Minify CSS & JavaScript
This removes empty space, comments, etc to reduce overall size of requests. This
can be done within the FireFox Yslow component under tools
Minification (say it, its cool)
21. SMUSH IT!
This optimizes your image sizes and within the FireFox tool it will allow you to
download a zip of your images maintaining the file structure so you can easily
replace your images
Enable Caching
22. Other Tweaks
These two tools provide a large number of tweaks that you can do as a developer
such as:
• Combining Javascript
• Combining CSS
• Removing duplicate CSS & Javascript
Definitely spend more time here, RTFM, Experiment and remember, backup!
I’m Back!!!
23. CDNs & Cookieless Servers
Two items that come up frequently are CDN‟s & Cookieless Server so let‟s just
touch on them quickly.
C’mon Is there an easier way?
24. How to get this automatically
Today a handful of companies are popping up that provide “optimized content
serving” they provide content optimization, CDN services and frequently security
services 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 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. 5 Minutes of SQL Kung Fu
TO 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.
• 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. 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.
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.
32. WebPI
Problems 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. Why WebMatrix
Three 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.
35. Classic Hosting
Dedicated Hosting Shared Hosting
This started it all, a This is what most people
computer in a closet at some associate with when they
ISP. hear hosting.
Today Dedicated Hosting is • Generally all services
still very similar (except the reside on a single
closets and computers are machine.
bigger)
Pay Attention Kurt!
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. 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!
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