views:

687

answers:

3

Hello,

I have a project in asp.net mvc, my hosting is using IIS6, and the first request after the website sit's idle is very slow. I looked at, http://forums.asp.net/t/1418959.aspx and asked the hosting for this settings. They say that the actual settings are:

"The pool is set with Idle Timeout disabled, Rapid-fail enabled and with a single worker process."

But still slow at the first request. Do you have any other clues?

Thanks in advance,

Alfredo

+1  A: 

Just a guess, but perhaps you are caching some data, that needs to be refreshed after the site has been idle for some time ?

If this is not the case, then my guess would be that the worker process has been shut down for some reason (it could be for some other reason than the idle timeout in IIS). If you need to check whether this might be the case, you could add some code to the Application_Start event that logs the startup event to a file or whatever logging you have in place. After some time in operation, you can examine the logs and see, how many Application_Start events has occured.

driis
No, i am not catching anything. I already asked the hosting to log the worker process events, see:http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/87892589-4eda-4003-b4ac-3879eac4bf48.mspx?mfr=truebut i will try that too. Thanks!
Alfredo Fernández
+4  A: 

This is natural.

IIS is often configured to shut down the website if it's a certain age or if there hasn't been a request in awhile. Your website has to be loaded (and possibly compiled) when the first request comes after asp.net has been shut down by IIS.

The common solution is to precompile your website before publishing it to the server.

Will
I'm agree with you
omoto
Precompiling don't matter with ASP.NET MVC, it is a web application type project under the hood.
Wyatt Barnett
Wyatt is righthttp://stackoverflow.com/questions/336205/can-i-precompile-my-asp-net-mvc-application
Alfredo Fernández
Finally it worked! but i want to try to make it work without precompiling the web. Thanks!
Alfredo Fernández
+5  A: 

You are probably a victim of worker process recycling. Ask your host how often the worker processes are recyled.

When a worker process is recycled, it has to recompile and restart the entire web application, and that's what causes the slowdown.

Jeff Hardy
Yes, that was my first try, as is the solution proposed in the link i put, but the hosting already changed the settings for that and still not working. But thanks!
Alfredo Fernández
How long does it take before the slow down occurs? Also, process recycling and the idle timeout are not the same thing (I might not have made that clear) - are you sure your host changed the right one?
Jeff Hardy
Ok! I missunderstood you, my host says that the worker process recicles every 24 hours. Now is working well precompiling the website, but i will set a test environment and try to log some events to know, how longs it takes, I want to find a solution without precompiling. i'll let you know. Thanks again!
Alfredo Fernández