ASP.NET + IIS Server startup performance problems

.net , asp.net , db Durham, United States
  • 13 years ago

    Hello,

    I am having some trouble with performance issues using ASP.NET. 

    We have a single code-base that is used as a wrapper for multiple sites.  The data for the site is populated from the database, and based on the URL of the site, displays different content.  Currently there are 30 different sites in IIS, all in the same Application Pool, and all pointing at the same code-base. 

    The performance issue is, when we have to make an update to the code, the sites take upwards of 10 minutes to start responding again.  During that time, the web server CPU is at 100% while several instances of "csc.exe" are running.  Basically, when the code is sufficiently changed to cause a site-wide recompile, all 30 sites try to recompile at the same time.  A single site takes less than a minue to compile, however the time increases geometrically as the number of concurrent sites increases.

    I have tried moving sites to individual containers, however this actually makes things worse.  Not only does the memory usage increase six-fold, but it also increases the overall duration of the down-time.

    I have also experimented with pre-compiling the code using "aspnet_compile.exe", and then deploying only the binaries to the site.  The performance does improve significantly, however, it is still taking far too long for the sites to come back up. 

    In the %windir%\Microsoft.Net\Framework\<.netver>\Temporary .NET Files\root directory there are several directorys with 8-character names (like f003da03, and the like).  Upon cleaning this directory and restarting IIS, and visiting each of the sites one directory appears for each website.  I would expect this to happen for JIT-Compile code since ASP.NET needs a place to reference a code-base from, however this also happens for pre-compiled code.  It seems that when loading the site for the first time, even from binaries, a copy of the necessary binaries is made in the temporary directory.  This process of copying up to 20 megabytes of DLL files, per site, from the webroot, to the temporary directory slows down the site startup performance greatly.

    Does anyone know if it is possible in IIS to prevent this from happening?  Specifically, is there a way to force IIS to read the binaries directly from the webroot, without making a copy in the temp directory?  Does anyone have any suggestions for how to improve startup performance?

    Thank you in advance for any help

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov