I have an MVC3 C# .Net web app using IIS 6 on windows server 2003.
We are experiencing some performance issues. Mainly on the initial load of a page.
I have compiled the app into Release mode and the performance is way better than in Debug. But, still the first load of a page is slow and also if the page lies dormant for a period of time, and the user re-engages the app, the page loads slowly again. It seems to me that there is runtime compiling going and that, once compiled, objects time out after a period.
What can I do to speed up the initial page loads and the extended dormant page loads?
Is there a way to simulate and load a page automatically at some interval?
Thanks
What you are experiencing the loading and unloading of the Application Pool in IIS. Think of your web application like any desktop application on your computer. It takes time to actually open the program, but once open -> actions within the program run quickly. So, the first time you hit your web application, IIS is starting up the application inside of the App Pool.
The second item you are seeing is IIS unloading the app pool after a period of inactivity (default 20 minutes). After the default period, the app pool in unloaded. When a request comes in to your application, IIS again has to start up the application before it can serve the request.
As for when a user first hits the web application, there is nothing you can really do to speed this up, it happens. Anytime you change your web.config or alter items in the Bin folder, IIS will recycle the app pool.
For the idle timeout concern, you can adjust how long IIS waits until it unloads the app pool (up to a maximum of 29 hours I believe).
IIS 6 – App Pool Timeout Change
[IIS 7 – App Pool Timeout Change]