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

有帮助吗?

解决方案

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().

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top