4

Our ASP.Net webforms site often takes five minutes to start up and render the first page after an IISReset or build in Visual Studio. We’ve used things like the optimizeCompilations attribute in web.config, and have made some progress but would like to know more about why it takes so long and where the exact bottlenecks are.

Are there tools out there we can use to instrument and analyze what’s going on during an ASP.Net website startup? We're using IIS7 and our website is compiled in .Net 4.0.

larryq
  • 15,713
  • 38
  • 121
  • 190
  • Check this out: [Slow first page load on asp.net site](http://stackoverflow.com/questions/2102609/slow-first-page-load-on-asp-net-site). Also, you can browse this search for some possible insight: [Highest voted questions tagged with "asp.net" and "performance"](http://stackoverflow.com/questions/tagged/performance+asp.net?sort=votes&pagesize=50). Good luck! – Josh Darnell Mar 08 '13 at 17:14

1 Answers1

5

The reason that its take too long is the batch compile found on the Compilation key on web.config.

You can change some of the batch relative parameters to limit the batch compile to fewer pages/modules, so your site starts a little faster. The Schema and the values that affect that:

<compilation 
   debug="[true|false]"
   batch="[true|false]"
   batchTimeout="number of seconds"
   maxBatchSize="maximim number of pages"
   maxBatchGeneratedFileSize="maximum combined size"
   numRecompilesBeforeAppRestart="number"
   optimizeCompilations="[true|false]"

If you like to get an idea of whats is happening at the compile time you can try to use the Process Monitor from MS Windows SysInternals. You can see all the file reading and compile at that moment, and what is opening/checking etc.

Example of what I us locally (not on server)

<compilation debug="true" batch="false" 
     optimizeCompilations="true" maxBatchGeneratedFileSize="800" maxBatchSize="100" >
Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150