DotNetNuke is a large ASP.NET CMS which is mostly pre-compiled, as are most of the modules contained within.
When we deploy our DotNetNuke site changes, we have two bits of recompilation that occur upon the first page hit.
- Application-level recompilation that occurs when a DLL is replaced in the bin folder
- Each time an individual module is accessed for the first time, some recompiling occurs on that specific module.
Is there a way to allocate more of the CPU capacity to compiling asp.net sites in IIS 7?
- I’d like to use more than one core, or at least do something to reduce recompile time.
Q&A
You should use pre-compiled ASP.NET. Why aren’t you?
- We are using pre-compiled ASP.NET. Just because an ASP.NET app is compiled into a DLL does not mean that the ASP.NET runtime will not do additional recompiling in order to serve it to vistiors.
How do you know it’s recompiling and not populating the cache or something?
- Viewing the task manager on the server shows 50% CPU usage by the compiler executable during the aforementioned page hits. Why 50%? 2-core server.
Set
<compilation optimizeCompilations="true" />Source: compilation Element (ASP.NET Settings Schema)
More information about the pros and cons can be found at Understanding ASP.NET Dynamic Compilation, under Optimizing Dynamic Compilation. The primary cause of errors are removal or changes in existing method signatures, causing already compiled pages to throw a MissingMethodException until they are recompiled.
You could also look into reducing the batch size for batch compilation, or disable it completely. I believe this will reduce compilation times for single pages, but generate more assemblies and consume more memory.