<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gojko Adzic &#187; iis</title>
	<atom:link href="http://gojko.net/tag/iis/feed/" rel="self" type="application/rss+xml" />
	<link>http://gojko.net</link>
	<description>Building software that matters</description>
	<lastBuildDate>Wed, 04 Aug 2010 11:38:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>IIS7: Component architecture and better diagnostics, but still not an application server</title>
		<link>http://gojko.net/2008/01/15/iis7/</link>
		<comments>http://gojko.net/2008/01/15/iis7/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 20:21:47 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[iis]]></category>

		<guid isPermaLink="false">http://gojko.net/2008/01/15/iis7/</guid>
		<description><![CDATA[Martin Parry from Microsoft&#8217;s Developer and platform group presented the upcoming server version of IIS 7 last week in Reading. The new version has some really interesting features that will make life easier for developers. A client server? It is a bit strange for a product that has the word “services” in its name to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/157966_waiter.jpg" style="margin:5px 5px 5px 5px; border:1px solid black" align="left"/><a target="_blank" href="http://www.martinparry.com">Martin Parry</a> from Microsoft&#8217;s Developer and platform group presented the upcoming server version of IIS 7 last week in Reading. The new version has some really interesting features that will make life easier for developers.<span id="more-87"></span></p>
<h2>A client server?</h2>
<p>It is a bit strange for a product that has the word “services” in its name to have a client version, but basically the “client” variant of the Internet Information Services was released with Vista, and “server” will come with Windows Server 2008, hopefully later this year. The “server” version is presently available as a release candidate, and can be downloaded with <a target="_blank" href="http://www.microsoft.com/windowsserver2008">WS2008</a>. Martin did not go into much detail about the differences of those two versions, but he said that the client has limited functionality and throughput. The good news is that the limitation of a single web site, that bugged web developers on Windows XP with IIS 6, is now removed.  </p>
<p>As the demonstration switched from Vista to a virtual WS2008 server to show the new management console and diagnostics features, I can only suppose that such features are not yet integrated into the “client” version. </p>
<h2>Modular architecture</h2>
<p>What was before w3svc is now split into two services. W3svc still exists, but it only deals with the HTTP kernel driver. The rest is in in the Windows Process Activation Service (codename WAS), which is further modularised into the Configuration manager, Process manager and Listener adapter interface. The responsibilities of the first two modules are pretty clear from their names, but the third module is a real novelty. It uses the Windows Communication Framework to allow plugging various listeners into the pipeline, so that requests can come across HTTP, but also raw TCP, named pipes or MSMQ message queues. </p>
<p>When the request comes in, it is sent through the request pipeline. This is where the biggest difference from IIS 6 comes into play &#8212; a modular architecture of the request pipeline. It looks like IIS7 is completely rewritten in .NET, because it enables developers to replace any part of the request pipeline with a custom module, written either in .NET or native code. Although .NET HTTP modules were supported in IIS6, the request had to come under the ASP.NET domain to use such flexibility, and you could not really replace standard functionality for authentication or logging or inject something into the pipeline without writing an ISAPI extension. Now, ASP.NET HTTP modules are truly utilised to the full extent. If you want, you can remove any standard module and replace it with your own, and do all that in .NET.</p>
<p>This gets even better &mdash; if you write a module in .NET, it does not have to be globally active or installed for the whole server. It can be loaded from web.config in a web application folder, so no special administrative privileges are required to change the pipeline. </p>
<p>Native modules and ISAPI extensions are still supported, but they have to be registered on the server level and have to be defined globally. You can, however, prevent the worker process from loading them for your application.</p>
<p>One more good thing about this is that the standard pipeline is now broken down into a number of DLLs, and you can actually prevent the system from loading any one of them. With IIS6, they were all in three big DLLs and loaded by default. Excluding modules that are not required will help lock down the server better, so this is a good security feature.</p>
<h2>No more metabase</h2>
<p>Another nice new feature of IIS 7 is that the configuration is now truly modularised. The big metabase is gone &mdash; and is now replaced with a system-wide text file called applicationHost.config (the IIS equivalend of machine.config) and web-site or folder local configuration in web.config files. The good news is that web.config can now override any setting. That includes modules, as I&#8217;ve already mentioned, but also error handlers, MIME mappings and all the other stuff that had to be edited in the metabase earlier. </p>
<p>The new administration console supports “delegation” &mdash; giving privileges to administer parts of the site or certain options to individual users. This works even with HTTP authentication of non-windows users, so you no longer have to open a local system or domain account for individual web site administrators. Any activity can be marked as not delegated, read-only or read/write for a particular user, and the user&#8217;s view is trimmed according to permissions. The console can even work remotely over HTTPS. All these improvements should appeal to people using shared hosting services or maintaining a large number of web sites.</p>
<h2>Better diagnostics</h2>
<p>IIS7 comes with something called “runtime status and control API” which allows developers to programmatically access diagnostic information about the running server. Lots of information on application pools and active requests should be available via this API, and it is also accessible within the IIS admin tool. Martin showed a demo of that tool, quickly displaying all active requests, their details and information on worker processes. The console even displays the module that is currently executing the request, which will be great for troubleshooting.</p>
<p>For better problem-solving, IIS7 also supports &#8220;failed requests tracing&#8221; (codename FREB). That basically comes down to dumping lots of tracing information into files only if certain conditions are met, such as status code, timeout or a generated trace event of a specific severity. The XML result contains the whole pipeline, duration of every executed step in milliseconds, exception information and a lot more. This feature does have performance implications (as tracing is buffered for all requests, and then only flushed if the trigger condition is met), and has to be enabled on the web site level. So I guess that it should not be used for general alerting, but only turned on when a serious problem is being looked at.</p>
<h2>First impressions</h2>
<p>IIS7 seems like a nice idea, especially the modularised pipeline, and I see how it could help us do our work faster. I&#8217;d like to see the production version and its performance before passing final judgement, but the demo really looked prommissing. </p>
<p>One thing that is notably missing, at least in my opinion, is the ability to run services that are not request-based. For more complex background processing, IIS7 still requires a windows service and the web application will have to use IPC to talk to it. Microsoft PR seems to have moved from the claim that IIS is an application server, with IIS 7 now presented as a “web application server” rather than an “application server” as was <a target="_blank" href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/ddf1d92f-3e6e-423f-b024-35cefc10a22f.mspx?mfr=true">IIS6</a>, so it does not seem likely that we will soon get the option to start a background service and chat with it from the web layer without the overhead of IPC and switching from managed mode.</p>
<p>For more information on the upcoming release, see  Microsoft&#8217;s new IIS portal, <a target="_blank" href="http://www.iis.net/default.aspx?tabid=7">IIS.NET</a>.</p>
<p>Image credits: <a href="http://www.sxc.hu/profile/keb" target="_blank">Karl-Erik Bennion</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2008/01/15/iis7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Golden rule of web caching</title>
		<link>http://gojko.net/2007/11/29/golden-rule-of-web-caching/</link>
		<comments>http://gojko.net/2007/11/29/golden-rule-of-web-caching/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 17:37:26 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://gojko.net/2007/11/29/golden-rule-of-web-caching/</guid>
		<description><![CDATA[Effective content caching is one of the key features of scalable web sites. Although there are several out-of-the-box options for caching with modern web technologies, a custom built cache still provides the best performance. The primary aim of caching is to speed up processing and reduce load on critical resources. In case of web sites, [...]]]></description>
			<content:encoded><![CDATA[<p><img src='/images/869106_music.jpg' style='border:1px solid black;margin:5px 5px 5px 5px;' align='left'/>Effective content caching is one of the key features of scalable web sites. Although there are several out-of-the-box options for caching with modern web technologies, a custom built cache still provides the best performance. <span id="more-73"></span></p>
<p>The primary aim of caching is to speed up processing and reduce load on critical resources. In case of web sites, the most critical resource is probably going to be the database &#8211; so dataset caching is a common solution to speed up the web. It is relatively easy to implement, and it can be introduced almost transparently into an existing system. But that is just  painting the corpse. First of all, dataset caching requires the same source data to be re-processed over and over, and takes up unnecessary CPU cycles. Also, a lot of data from recordsets is often not displayed directly, so dataset caching can lead to a lot of wasted memory &#8211; in fact, I&#8217;ve seen sites where this approach caused serious problems by fragmenting memory under heavy load and leaving the application without enough memory to run. </p>
<p>Although the web site will, no doubt, benefit significantly even from a dataset cache, it will scale much more and better if the cached content is closer to the final product. How much closer, that depends on the application. The golden rule of web caching is: <i>For the caching to be most effective, cache as close to the final product as possible</i>.</p>
<h2> Ideally, cache content into static files</h2>
<p>The best option for caching, if possible, is to use static files on the disk and allow web servers to publish those files directly. All web servers will process static files very efficiently, and that will also leave more resources for stuff that needs to be processed dynamically. Content on the disk does not take up valuable memory space available for the web application, and it absolutely minimises CPU requirements per request.</p>
<p>Here are the results of a stress test I recently did on a fairly good web server machine running IIS6 over a gigabit network. I measured the number of requests per second during a two-minute stress load for serving the a couple of files using several techniques. </p>
<table style="text-align:right; border:1px solid black;" align="center">
<tr style="background-color:#dddddd">
<td style="text-align:left">Requests/s <b>\</b> file (KB)</td>
<td>64</td>
<td>32</td>
<td>16</td>
<td>8</td>
<td>4</td>
<td>2</td>
<td>1</td>
<td>0.5</td>
</tr>
<tr style="background-color:#dddddd">
<td style="text-align:left">theoretic network capacity</td>
<td>2,048.00</td>
<td>4,096.00</td>
<td>8,192.00</td>
<td>16,384.00</td>
<td>25,600.00</td>
<td>51,200.00</td>
<td>102,400.00</td>
<td>204,800.00</td>
</tr>
<tr style="background-color:#eeeeee">
<td style="text-align:left">Static</td>
<td>1,786.16</td>
<td>3,531.10</td>
<td>7,013.06</td>
<td>11,545.83</td>
<td>13,154.12</td>
<td>14,278.29</td>
<td>14,336.17</td>
<td>14,371.84</td>
</tr>
<tr>
<td style="text-align:left">ASP-SSI</td>
<td>1,752.93</td>
<td>3,514.08</td>
<td>6,823.75</td>
<td>7,599.36</td>
<td>8,057.98</td>
<td>7,874.10</td>
<td>8,246.19</td>
<td>8,358.91</td>
</tr>
<tr style="background-color:#eeeeee">
<td style="text-align:left">ASP-Include</td>
<td>1,781.35</td>
<td>3,527.30</td>
<td>5,686.10</td>
<td>6,053.17</td>
<td>6,309.94</td>
<td>6,372.38</td>
<td>6,449.43</td>
<td>6,463.96</td>
</tr>
<tr>
<td style="text-align:left">ASP-Nocache</td>
<td>233.93</td>
<td>493.50</td>
<td>925.55</td>
<td>1,562.07</td>
<td>2,622.32</td>
<td>3,507.78</td>
<td>4,001.26</td>
<td>4,309.78</td>
</tr>
<tr style="background-color:#eeeeee">
<td style="text-align:left">ASP-Cache</td>
<td>1,264.07</td>
<td>2,540.00</td>
<td>3,571.16</td>
<td>4,878.81</td>
<td>5,265.62</td>
<td>5,497.21</td>
<td>5,653.36</td>
<td>5,708.31</td>
</tr>
<tr>
<td style="text-align:left">ASPX-Nocache</td>
<td>1,560.03</td>
<td>2,000.51</td>
<td>3,641.76</td>
<td>4,500.16</td>
<td>5,390.68</td>
<td>5,770.47</td>
<td>6,561.65</td>
<td>6,150.49</td>
</tr>
<tr style="background-color:#eeeeee">
<td style="text-align:left">ASPX-Cache</td>
<td>1,782.68</td>
<td>3,507.56</td>
<td>6,612.81</td>
<td>9,301.24</td>
<td>9,542.29</td>
<td>9,100.19</td>
<td>11,591.58</td>
<td>11,375.98</td>
</tr>
<tr>
<td style="text-align:left">ASPX-Include</td>
<td>1,777.88</td>
<td>3,491.74</td>
<td>6,447.18</td>
<td>8,964.44</td>
<td>9,359.95</td>
<td>9,281.08</td>
<td>11,304.62</td>
<td>11,198.98</td>
</tr>
<tr style="background-color:#eeeeee">
<td style="text-align:left">ASPX-SSI</td>
<td>1,790.19</td>
<td>3,568.56</td>
<td>6,497.78</td>
<td>9,032.19</td>
<td>9,267.66</td>
<td>9,707.82</td>
<td>11,224.71</td>
<td>11,000.50</td>
</tr>
</table>
<ul>
<li>Static – file served directly by IIS from disk</li>
<li>ASP-SSI – file included using #include SSI directive in an ASP file (turning on the SSI engine)</li>
<li>ASP-Include – file included using #include SSI directive in an ASP file but with an ASP statement <i>if (true)</i> around the include (so turning on the ASP engine as well)</li>
<li>ASP-Cache – file read from disk using FSO, but cached in an Application object for up to 10 seconds.</li>
<li>ASP-Nocache – file read from disk on every request using FSO</li>
<li>ASPX-SSI – file included using #include SSI directive in an ASPX file</li>
<li>ASPX-Include – file included using #include SSI directive in an ASPX file, with an additional C# if (true) block around the include</li>
<li>ASPX-Cache – file read from disk but cached using ASP.NET page caching for 10 seconds</li>
<li>ASPX-NoCache – file read from disk on each request, page caching turned off</li>
</ul>
<p>The difference between “static” and “aspx-cache” is the pure overhead of using the ASP.NET engine. For a 4KB file, we get a 38% increase of performance from a file based cache over even the ASP.NET page caching mechanism. Compared to a simple cache based on the Application object in ASP, the performance increase is 150%. And this is just for managing completely static content. A typical web application would pull the content from a database or format it, leading to much bigger differences. Also interesting is the difference between ASP-Include and ASP-SSI, effectively the cost of having turning on the ASP engine (having <i>if(true)</i> statement in ASP code). The good news is that difference between those two cases in ASP.NET is negligible.</p>
<p>With larger files we hit the bandwidth bottleneck first, so the benefits of a file based cache are not that visible. However, with the growing number of Ajax-based sites, pages are getting split into smaller independent requests, and so the overhead becomes quite noticeable. Although ASP.NET page caching is a great utility given that it almost requires no work to implement, file based cache can also be split across the server farm, allowing multiple machines to use the same content. </p>
<p>Caching into static files also brings the benefit of automatic support for last modification timestamps. For browsers with HTTP 1.1 support, if the same files are downloaded often (live Ajax updates), the server can actually reply just with the “304 Not modified” header, without sending any file content at all. Cache that works directly from disk files also allows us to use lightweight HTTP servers such as <a href="http://www.lighttpd.net" target="_blank" >LightHTTPD</a> to get some extra performance from the same hardware. </p>
<h2>Not just for pre-publishing</h2>
<p>The file based cache is often used for pre-publishing content, but there is a simple trick to use this technique for on-demand publishing, even for content that must be generated often on the fly. Most web servers I have worked with, including IIS and Apache, will allow us to override the 404 &#8220;Not found&#8221; handler. This can be used to implement the cache-miss scenario: when users request a file that has not yet been cached, IIS will not find it on the disk and will call the 404 handler; we can then generate the file using dynamic processing (ASP/ASP.NET) and store it to the disk for the next request before sending the content back to the client. The same technique can be used with Apache and PHP. </p>
<p>An important note for this technique is that requests must be mapped completely to the file path of the URL, not to GET parameters. So, for example, instead of using <i>http://myserver/search.aspx?query=fitnesse</i>, we would have to use something like <i>http://myserver/search/fitnesse.query</i>. Then a 404 handler would be set up on the <i>search</i> folder to perform a search based on the active URL path and store it into the <i>fitnesse.query</i> file. You can generally chose any extension you want, but avoid ASP/ASPX and other standard extensions, to prevent IIS from turing on ASP/ASP.NET processing when serving those files. HTML and TXT extensions are also not a good choice. IE uses &#8220;smart&#8221; caching by default, so HTML files are downloaded just once per page. If you fire a background AJAX request twice for a HTML file, only the first will actually go to the server. TXT and HTML files may also be cached by transparent proxy systems, so it&#8217;s best to avoid using those extensions. </p>
<p><b>Image credits:</b> <a href="http://www.sxc.hu/profile/therysma" target="_blank">Akis Kolokotronis</a>/SXC</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2007/11/29/golden-rule-of-web-caching/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
