Reputation: 4244
I have an ASP.NET MVC app running in IIS7. Sometimes when I type the URL into a browser it takes 5-10 seconds before it responds, then after that it is fine. It's like it's taking it's time starting/waking up.
How should I best proceed with trying to identify the problem?
Upvotes: 1
Views: 1413
Reputation: 6085
You can use ASP.NET Mini Profiler to check what takes too long to load. Web.config re-saving can cause your application to be restarted and if your website is not compiled, it takes longer to load as well, plus if you have a heavy database call. In other words, there's no general solution for this, it depends on how you design the application and then improve what appear to be not efficient.
Upvotes: 0
Reputation: 69953
This is probably normal behaviour rather than a problem. It's probably going to sleep because it hasn't had any requests for a long time. You can try changing the Idle Timeout under the Application Pool's advanced settings or if you're running .NET 4.0, you can keep the application always running.
Upvotes: 2
Reputation: 3530
If this is happening right after you've edited ASPX files or rebuilt other .NET sources (e.g., *.cs), then it's probably because of the JIT native code generation of the .NET code. This can be solved by a warm-up utility like the (currently defunct, sadly) IIS warm-up module.
Upvotes: 1