GeoCaching Minification For Crying Out Loud JUST MAKE IT FAST!Blah-Blah-Blah Optimization Optimizing Your Website
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
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/
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
Before We Begin: Backup IISBackup IIS: %windir%system32inetsrvappcmd add backup “rutroh”Restore IIS Backup: %windir%system32inetsrvappcmd restore backup “rutroh” Backup Is Your Friend
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!
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!
Enable Browser & Proxy CachingNOTE: You might not be able to get everything but don‟t worry. Not Perfect but faster!
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
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
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?
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!
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)
5 Minutes of SQL Kung FuTO SAVE YOU 5 DAYS OF SQL GRIEF! Zzzz
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
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.
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.
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.
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.
Now Let’s Talk The Cloud Web Hosting != The Cloud
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!
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!
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!