After enabling IIS 7.5 autorun, the first request is still slow

I set the startMode = "AlwaysRunning" attribute in my application pool and the serviceAutoStartEnabled = "true" attribute in my application in the IIS configuration. I even configured serviceAutoStartProvider and I see that the code is "warming up". I also see that the w3wp process starts automatically after iisreset. However, the first request to my ASP.NET MVC application is as slow as it was without starting automatically. Is there some point that I am missing, or is there any way to easily debug it without a profiler?

Is this feature expected to affect the performance of the first request? Actually the main part of the work on the first request, given that the workflow is ready, the .NET appdomain and even all .NET assemblies are loaded?

+4
source share
1 answer

I studied this recently.

As far as I can tell, the autoStart function will cause your IIS workflows (by default, only one for the pool) to compile JIT before the first request.

However, what compiled seems to represent just most of the assemblies and dependencies, but not necessarily any methods.

When this first request occurs, and your methods that you wrote are called for the first time, JITer finally compiles those methods that have not yet been compiled.

The advantage of autoStart is that it allows .Net to do 90% of the work, but the last 10% is still paid when the first request occurs, and those methods that were not yet available are started for the first time.

+2
source

All Articles