<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Developer Flotsam &#187; Slow Compilation</title>
	<atom:link href="http://jakkaj.wordpress.com/tag/slow-compilation/feed/" rel="self" type="application/rss+xml" />
	<link>http://jakkaj.wordpress.com</link>
	<description>Developer Flotsam - random stuff floating around?</description>
	<lastBuildDate>Sat, 04 Feb 2012 09:46:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jakkaj.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/c69967a9056213792a3a7b47a6f573af?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Developer Flotsam &#187; Slow Compilation</title>
		<link>http://jakkaj.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jakkaj.wordpress.com/osd.xml" title="Developer Flotsam" />
	<atom:link rel='hub' href='http://jakkaj.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Slow compilation of large ASP.NET sites on IIS</title>
		<link>http://jakkaj.wordpress.com/2007/11/16/slow-compilation-of-large-aspnet-sites-on-iis/</link>
		<comments>http://jakkaj.wordpress.com/2007/11/16/slow-compilation-of-large-aspnet-sites-on-iis/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 01:06:20 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[KB931212]]></category>
		<category><![CDATA[Slow Compilation]]></category>

		<guid isPermaLink="false">http://jakkaj.wordpress.com/2007/11/16/slow-compilation-of-large-aspnet-sites-on-iis/</guid>
		<description><![CDATA[Let me start by saying this is not about slow compilation in VS 2005. If you are experienceing slow performance in Visual Studio, then look here. Background Our CMS utilises ASP.NET to render the live site that the end users see. The CMS basically publishes an ASP.NET site as if you hand wrote it yourself. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jakkaj.wordpress.com&amp;blog=1986956&amp;post=8&amp;subd=jakkaj&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let me start by saying this is not about slow compilation in VS 2005. If you are experienceing slow performance in Visual Studio, then look <a href="http://weblogs.asp.net/scottgu/archive/2006/05/08/VS-2005-Web-Application-Project-V1.0-Released.aspx" title="ScottGu's Blog">here</a>.</p>
<p><strong>Background</strong></p>
<p>Our CMS utilises ASP.NET to render the live site that the end users see. The CMS basically publishes  an ASP.NET site as if you hand wrote it yourself. The management classes and ASPX pages behind this are pre-compiled and the pre-compiled configuration file is set to allow updates i.e.:</p>
<pre>&lt;precompiledApp version="2" updatable="true"/&gt;</pre>
<p>This allows us to have a nice strong pre-compiled set of management classes etc whilst allowing the publication system to send new ASPX files to the live site at any time.</p>
<p>This means that there are heaps of ASPX files on the site possibly needing to be compiled at any given time (on some of our larger client sites there could be 20,000 ASPX files).</p>
<p><strong>Problem</strong></p>
<p>Normally you would expect that a new page would be compiled on the first visit and then run fast and efficient for subsequent hits&#8230; however a few months ago (June maybe) Microsoft released a patch which caused a few headaches to a large non-pre-compiled site.</p>
<p>Our clients started ringing up complaining about slow downs after publication (i.e. a page had to be re-compiled by ASP.NET). Some of the slow downs were 15 or more minutes! The CPU and memory would max out even quite high spec machines &#8211; and the site would become totally unresponsive.</p>
<p>After some head scratching and remote access to the client networks (we couldn&#8217;t replicate the problem in our environment) and lots of file monitoring, run-time monitoring etc. I finally realised that ASP.NET was re-compiling every page in the site (including a special cache we keep for system purposes). Naturally on a large site this was taking forever. Further research on our part tracked the problem back to the KB article <span style="font-size:11pt;font-family:'Calibri','sans-serif';color:#1f497d;"><a href="http://go.microsoft.com/fwlink/?LinkId=91233" title="KB Article 931212" target="_blank">http://go.microsoft.com/fwlink/?LinkId=91233</a>.</span> Being a security update, some of our clients installed it straight away &#8211; against our general advice (i.e install to staging environment first <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<p>The solution is however quite simple:</p>
<pre><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&lt;</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:maroon;">configuration</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&gt;</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:black;">
    </span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&lt;</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:maroon;">system.web</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&gt;</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:black;">
        </span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&lt;</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:maroon;">compilation</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:red;"> debug</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">="false"</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:red;"> batch</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">="false"</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:#1f497d;"> </span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:red;">numRecompilesBeforeAppRestart</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">="50"&gt;&lt;/</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:maroon;">compilation</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&gt;</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:black;">
    </span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&lt;/</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:maroon;">system.web</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&gt;</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:black;">
 </span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&lt;/</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:maroon;">configuration</span><span style="font-size:10pt;font-family:'Arial','sans-serif';color:blue;">&gt;</span></pre>
<pre></pre>
<p>Update your web.config file and add in the attribute batch=&#8221;false&#8221; to the compilation line. The problem was that the framework patch had turned on batch compilation mode by default &#8211; causing obvious compilation delays (well this is what we assume has happened &#8211; information was a little scarce about the problem, most sites are not as dynamic as an Objectify live site). With this setting, affected machines now compile only one page at once. <a href="http://msdn2.microsoft.com/en-us/library/s10awwz0.aspx" title="Compilation Element">Click here</a> for more information.</p>
<p>You will also notice another setting here &#8211; numRecompilesBeforeAppRestart. Normally ASP.NET will cycle the worker process after 15 dynamic compiles. You can extend this out depending on your needs.</p>
<p>One final note&#8230; if you do use a dynamic site, remember that InProc state management is bad! Your sessions will be lost after 15 compiles!</p>
<p><strong>NB: </strong>We couldn&#8217;t absolutely prove it was the KB article i listed here that caused the problem&#8230; it was our investigation by comparing patches and applying patches in our environment that lead us to this (i.e. we ended up replicating the issue &#8211; thank god).</p>
<p><strong>Edit</strong></p>
<p>2007-11-28</p>
<p>I just remembered that the day(s) that I was investigating this issue as a matter of top priority was the same day that my entire company went to Calder Park Raceway to drive V8 Supercars! I missed out&#8230;oh boy that was a tough day.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jakkaj.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jakkaj.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jakkaj.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jakkaj.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jakkaj.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jakkaj.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jakkaj.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jakkaj.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jakkaj.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jakkaj.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jakkaj.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jakkaj.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jakkaj.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jakkaj.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jakkaj.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jakkaj.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jakkaj.wordpress.com&amp;blog=1986956&amp;post=8&amp;subd=jakkaj&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jakkaj.wordpress.com/2007/11/16/slow-compilation-of-large-aspnet-sites-on-iis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/310d76b78db597d9c9d0066df9654e51?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jordan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
