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?
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.)
您可以通过增加应用程序池的生命周期长度来防止它发生。在 IIS 中,转到应用程序池的文件夹并为您的站点选择池。右键单击,高级设置...,在 Process Model 下找到 Idle Time-out Minutes 并增加时间以匹配您的站点的使用。IE:如果你平均每小时有一个访客,那么 60 分钟就能让它活着。
在 IIS 重置后的第一次,它总是会至少执行一次。
您可以做的另一件事是获得一台速度更快的计算机,但您第一次挂起的次数总是比其他人多。