Question

I am suffering from very slow speed on initial loading of my MVC3 .NET4.5 application on Cloud Services, then of course when the pool recycles every 20 mins.

Now I could extend the recycling, but to my mind it would be a far better solution to simply precompile everything locally, then package it up and publish to Cloud Services.

How can I precompile locally, and then package up the precompiled code for publish?

Thanks

Was it helpful?

Solution

The problem is that the default MSBuild scripts that ship with Azure SDK do not include the precompilation results into the service package. So it's not a problem to precompile the application but it's a problem to have the precompilation results packaged. One possible solution is to precompile the application in-place as described here.

The 20 minutes idle timeout makes little sense for web roles so it's worth simply disabling it. The next thing you'll face is that starting the web application when the first request arrives still takes some time because a lot of code has to be loaded from disk and JIT-compiled and the workaround is to either use "warmup" features of IIS or simply send a request to "localhost" from inside role OnStart().

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top