12

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

  • On the server, try this: Run -> inetmgr -> expand MACHINE (local computer) -> select Application Pools -> right click the application pool -> Properties -> Performance tab -> Uncheck "Shutdown worker process after being idle for: (time in minutes)". (Also, the recycle time can be adjusted in the Recycling tab of this prompt.) – Patrick Jun 02 '14 at 16:33

3 Answers3

8

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
  • 7,632
  • 24
  • 24
  • 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 Sep 14 '09 at 20:35
  • 2
    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 Sep 14 '09 at 21:53
  • 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 Sep 17 '09 at 13:02
6

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.

2

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
  • 161,458
  • 45
  • 265
  • 341
  • 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=true but i will try that too. Thanks! – Alfredo Fernández Sep 14 '09 at 20:40