Question

I have a Windows Azure Cloud Service which is running:

MVC3, C#, EF4.1, Razor

on

Windows 2012 R2 with .NET4.5 in WACS(osFamily="4")

I am finding that if I leave the application for a little while, say 10-15 minutes, the initial duration of the process is very long, can be about 2 mins. I assume this is due to the assemblies dropping out of memory, and the IL code needing to be recompiled. I suspect this is also tied into the application pool recycling too often.

First off, is it possible to precompile my MVC3 application and then deploy to WACS so if the assembly is dropped/recycled then it will load again very quickly. If so, how? I may well have missed something very obvious.

I guess I can also alter the setting on the app pool within the WACS IIS manager?

Thanks in advance.

EDIT:

I have found : /p:PrecompileBeforePublish=true , but not sure how to use it in conjunction with the VS2012 Azure publish action.

Was it helpful?

Solution

Check http://blog.smarx.com/posts/controlling-application-pool-idle-timeouts-in-windows-azure for how to set the IIS idle timeout to never.

Essentially, you want to create a startup task that does:

%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top