First request is very slow after website sits idle with Asp.net mvc IIS6

浪子不回头ぞ 提交于 2019-12-20 10:53:33

问题


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:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/1422841/first-request-is-very-slow-after-website-sits-idle-with-asp-net-mvc-iis6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!