<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Omar AL Zabir blog on ASP.NET Ajax and .NET 3.5 : asp.net, IIS</title><link>http://msmvps.com/blogs/omar/archive/tags/asp.net/IIS/default.aspx</link><description>Tags: asp.net, IIS</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Best practices for creating websites in IIS 6.0</title><link>http://msmvps.com/blogs/omar/archive/2008/10/04/best-practices-for-creating-websites-in-iis-6-0.aspx</link><pubDate>Sat, 04 Oct 2008 10:05:22 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1649697</guid><dc:creator>omar</dc:creator><slash:comments>20</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=1649697</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2008/10/04/best-practices-for-creating-websites-in-iis-6-0.aspx#comments</comments><description>&lt;p&gt;Every time I create an IIS website, I do some steps, which I consider as best practice for creating any IIS website for better performance, maintainability, and scalability. Here&amp;#39; re the things I do:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Create a separate application pool for each web application&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I always create separate app pool for each web app because I can select different schedule for app pool recycle. Some heavy traffic websites have long recycle schedule where low traffic websites have short recycle schedule to save memory. Moreover, I can choose different number of processes served by the app pool. Applications that are made for web garden mode can benefit from multiple process where applications that use in-process session, in memory cache needs to have single process serving the app pool. Hosting all my application under the &lt;u&gt;DefaultAppPool&lt;/u&gt; does not give me the flexibility to control these per site.&lt;/p&gt; &lt;p&gt;The more app pool you create, the more ASP.NET threads you make available to your application. Each &lt;u&gt;w3wp.exe&lt;/u&gt; has it&amp;#39;s own thread pool. So, if some application is congesting particular &lt;u&gt;w3wp.exe&lt;/u&gt; process, other applications can run happily on their separate &lt;u&gt;w3wp.exe&lt;/u&gt; instance, running under separate app pool. Each app pool hosts its own &lt;u&gt;w3wp.exe&lt;/u&gt; instance.&lt;/p&gt; &lt;p&gt;So, my rule of thumb: Always create new app pool for new web applications and name the app pool based on the site&amp;#39;s domain name or some internal name that makes sense. For example, if you are creating a new website alzabir.com, name the app pool alzabir.com to easily identify it.&lt;/p&gt; &lt;p&gt;Another best practice: Disable the &lt;u&gt;DefaultAppPool&lt;/u&gt; so that you don&amp;#39;t mistakenly keep adding sites to &lt;u&gt;DefaultAppPool&lt;/u&gt;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="340" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_thumb_5F00_1.png" width="664" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;First you create a new application pool. Then you create a new Website or Virtual Directory, go to Properties -&amp;gt; Home Directory tab -&amp;gt; Select the new app pool.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_6.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="501" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_thumb_5F00_2.png" width="620" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Customize Website properties for performance, scalability and maintainability&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;First you map the right host headers to your website. In order to do this, go to WebSite tab and click on &amp;quot;Advanced&amp;quot; button. Add mapping for both domain.com and &lt;a href="http://www.domain.com"&gt;www.domain.com&lt;/a&gt;. Most of the time, people forget to map the domain.com. Thus many visitors skip typing the www prefix and get no page served.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_10.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="493" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_thumb_5F00_4.png" width="648" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Next turn on some log entries:&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_12.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="458" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_thumb_5F00_5.png" width="605" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;These are very handy for analysis. If you want to measure your bandwidth consumption for specific sites, you need the Bytes Sent. If you want to measure the execution time of different pages and find out the slow running pages, you need Time Taken. If you want to measure unique and returning visitors, you need the Cookie. If you need to know who is sending you most traffic - search engines or some websites, you need the Referer. Once these entries are turned on, you can use variety of Log Analysis tools to do the analysis. For example, &lt;a title="s" href="http://awstats.sourceforge.net/"&gt;open source AWStats&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;But if you are using Google Analytics or something else, you should have these turned off, especially the Cookie and Referer because they take quite some space on the log. If you are using ASP.NET Forms Authentication, the gigantic cookie coming with every request will produce gigabytes of logs per week if you have a medium traffic website.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_14.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="269" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_thumb_5F00_6.png" width="473" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This is kinda no brainer. I add Default.aspx as the default content page so that, when visitors hit the site without any .aspx page name, e.g. alzabir.com, they get the default.aspx served.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_16.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="461" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_thumb_5F00_7.png" width="475" border="0" /&gt;&lt;/a&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;Things I do here:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Turn on Content Expiration. This makes static files remain in browser cache for 30 days and browser serves the files from its own cache instead of hitting the server. As a result, when your users revisit, they don&amp;#39;t download all the static files like images, javascripts, css files again and again. This one setting significantly improves your site&amp;#39;s performance.  &lt;li&gt;Remove the &lt;u&gt;X-Powered-By: ASP.NET&lt;/u&gt; header. You really don&amp;#39;t need it unless you want to attach Visual Studio Remote Debugger to your IIS. Otherwise, it&amp;#39;s just sending 21 bytes on every response.  &lt;li&gt;Add &amp;quot;From&amp;quot; header and set the server name. I do this on each webserver and specify different names on each box. It&amp;#39;s handy to see from which servers requests are being served. When you are trying to troubleshoot load balancing issues, it comes handy to see if a particular server is sending requests. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_18.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="465" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_thumb_5F00_8.png" width="538" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;I set the 404 handler to some ASPX so that I can show some custom error message. There&amp;#39;s a 404.aspx which shows some nice friendly message and suggests some other pages that user can visit. However, another reason to use this custom mapping is to serve extensionless URL from IIS. &lt;a href="http://msmvps.com/blogs/omar/archive/2007/04/29/serve-extensionless-url-from-asp-net-without-using-isapi-module-or-iis-6-wildcard-mapping.aspx"&gt;Read this blog post for details&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_20.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="459" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.BestpracticesforcreatingwebsitesinIIS6.0_5F00_CC6A/image_5F00_thumb_5F00_9.png" width="471" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Make sure to set ASP.NET 2.0 for your ASP.NET 2.0, 3.0 and 3.5 websites.&lt;/p&gt; &lt;p&gt;Finally, you must, I repeat you &amp;quot;MUST&amp;quot; &lt;a href="http://msmvps.com/blogs/omar/archive/2006/08/10/iis-6-compression-quickest-and-effective-way-to-do-it-for-asp-net-compression.aspx"&gt;turn on IIS 6.0 gzip compression&lt;/a&gt;. This turns on the Volkswagen V8 engine that is built into IIS to make your site screaming fast.&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:B3E14793-948F-49af-A347-D19C374A7C4F:c9260f79-7b63-4c02-96a4-1a4a412a5a65" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt; &lt;script type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmsmvps.com%2fblogs%2fomar%2farchive%2f2008%2f10%2f04%2fbest-practices-for-creating-websites-in-iis-6-0.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmsmvps.com%2fblogs%2fomar%2farchive%2f2008%2f10%2f04%2fbest-practices-for-creating-websites-in-iis-6-0.aspx" border="0" /&gt;&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1649697" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/performance/default.aspx">performance</category><category domain="http://msmvps.com/blogs/omar/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://msmvps.com/blogs/omar/archive/tags/production/default.aspx">production</category><category domain="http://msmvps.com/blogs/omar/archive/tags/IIS/default.aspx">IIS</category></item><item><title>My first book - Building a Web 2.0 Portal with ASP.NET 3.5</title><link>http://msmvps.com/blogs/omar/archive/2008/01/13/my-first-book-building-a-web-2-0-portal-with-asp-net-3-5.aspx</link><pubDate>Sun, 13 Jan 2008 20:23:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1461326</guid><dc:creator>omar</dc:creator><slash:comments>44</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=1461326</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2008/01/13/my-first-book-building-a-web-2-0-portal-with-asp-net-3-5.aspx#comments</comments><description>&lt;p&gt;My first book &amp;quot;&lt;a href="http://www.oreilly.com/catalog/9780596510503/" target="_blank"&gt;Building a Web 2.0 Portal with ASP.NET 3.5&lt;/a&gt;&amp;quot; from O&amp;#39;Reilly is published and available in the stores. This book explains in detail the architecture design, development, test, deployment, performance and scalability challenges of my open source web portal &lt;a href="http://www.dropthings.com" target="_blank"&gt;Dropthings.com&lt;/a&gt;. Dropthings is a prototype of a web portal similar to &lt;a href="http://www.google.com/ig" target="_blank"&gt;iGoogle&lt;/a&gt; or &lt;a href="http://www.pageflakes.com" target="_blank"&gt;Pageflakes&lt;/a&gt;. But this portal is developed using recently released brand new technologies like ASP.NET 3.5, C# 3.0, Linq to Sql, Linq to XML, and Windows Workflow foundation. It makes heavy use of ASP.NET AJAX 1.0. Throughout my career I have built several state-of-the-art &lt;a href="http://omar.mvps.org" target="_blank"&gt;personal&lt;/a&gt;, educational, enterprise and &lt;a href="http://www.pageflakes.com" target="_blank"&gt;mass consumer web portals&lt;/a&gt;. This book collects my experience in building all of those portals.&lt;/p&gt;&lt;p&gt;O&amp;#39;Reilly Website:&lt;br /&gt;&lt;a href="http://www.oreilly.com/catalog/9780596510503/"&gt;http://www.oreilly.com/catalog/9780596510503/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Amazon:&lt;br /&gt;&lt;a href="http://www.amazon.com/Building-Web-2-0-Portal-ASP-NET/dp/0596510500"&gt;http://www.amazon.com/Building-Web-2-0-Portal-ASP-NET/dp/0596510500&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Disclaimer: This book does not show you how to build Pageflakes. Dropthings is entirely different in terms of architecture, implementation and the technologies involved.&lt;/p&gt; &lt;p&gt;You learn how to: &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Implement a highly decoupled architecture following the popular n-tier, widget-based application model  &lt;/li&gt;&lt;li&gt;Provide drag-and-drop functionality, and use ASP.NET 3.5 to build the server-side part of the web layer  &lt;/li&gt;&lt;li&gt;Use LINQ to build the data access layer, and Windows Workflow Foundation to build the business layer as a collection of workflows  &lt;/li&gt;&lt;li&gt;Build client-side widgets using JavaScript for faster performance and better caching  &lt;/li&gt;&lt;li&gt;Get maximum performance out of the ASP.NET AJAX Framework for faster, more dynamic, and scalable sites  &lt;/li&gt;&lt;li&gt;Build a custom web service call handler to overcome shortcomings in ASP.NET AJAX 1.0 for asynchronous, transactional, cache-friendly web services  &lt;/li&gt;&lt;li&gt;Overcome JavaScript performance problems, and help the user interface load faster and be more responsive  &lt;/li&gt;&lt;li&gt;Solve various scalability and security problems as your site grows from hundreds to millions of users  &lt;/li&gt;&lt;li&gt;Deploy and run a high-volume production site while solving software, hardware, hosting, and Internet infrastructure problems &lt;/li&gt;&lt;/ul&gt;If you&amp;#39;re ready to build state-of-the art, high-volume web applications that can withstand millions of hits per day, this book has exactly what you need.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1461326" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/sql+server/default.aspx">sql server</category><category domain="http://msmvps.com/blogs/omar/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://msmvps.com/blogs/omar/archive/tags/pageflakes/default.aspx">pageflakes</category><category domain="http://msmvps.com/blogs/omar/archive/tags/production/default.aspx">production</category><category domain="http://msmvps.com/blogs/omar/archive/tags/linq/default.aspx">linq</category><category domain="http://msmvps.com/blogs/omar/archive/tags/workflow/default.aspx">workflow</category><category domain="http://msmvps.com/blogs/omar/archive/tags/ajax/default.aspx">ajax</category><category domain="http://msmvps.com/blogs/omar/archive/tags/.net/default.aspx">.net</category><category domain="http://msmvps.com/blogs/omar/archive/tags/IIS/default.aspx">IIS</category></item></channel></rss>