asp.net site takes a while to load after restart

社会主义新天地 提交于 2019-12-13 14:28:56

问题


I have an asp.net 2.0 website running on IIS 7.5. The default page page_load event takes a while to load after a restart in iis 7.5. In the bottom it says "waiting for....".
If I hit the default page after without restarting iis it loads very quickly. I cant really post the exact code here. What could be the cause? Is it recompiling the whole website? If so how can I prevent this?


回答1:


You can prevent it by increasing the length of the application pool's life cycle. In IIS, go the Application Pool's folder and select the pool for your site. Right click, Advanced Settings..., locate Idle Time-out Minutes under Process Model and increase the time to match use of your site. IE: if you average one visitor per hour, then 60 minutes will keep it alive.

The first time after an IIS Reset it will always do that at least once though.

Another thing you can do is get a faster computer, but you'll always have more hang the first time than others.




回答2:


This is normal. It is, indeed, recompiling the site. There are several things that can cause a JIT recompile on an ASP.NET site.

More information can be found here. (It's an older version of the documentation. I chose the version of the documentation that is in line with the version of the Frameworkyou specified, but it's the same in all versions.)



来源:https://stackoverflow.com/questions/12738490/asp-net-site-takes-a-while-to-load-after-restart

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