IIS 10 ASP.NET 应用程序第二天启动缓慢,同时使用空闲超时操作:暂停

IIS 10 ASP.NET application startup slow next day while using idle timout-out Action: Suspend

我们目前使用的是亚马逊的 M2 大型服务器。

在 IIS 10 的应用程序池的高级设置中,我们使用这些选项,

Idle Time-out Action: Suspend

Idle Time-out (minutes): 1

Start Mode: OnDemand

Recycling Time Interval (minutes) : 1740

当第二天应用程序池处于挂起模式时,应用程序的启动仍然很慢。我们可以在使用这些设置时改进启动吗?

您的回收时间间隔为 1740 分钟或 29 小时。来自 https://weblogs.asp.net/owscott/why-is-the-iis-default-app-pool-recycle-set-to-1740-minutes ,

However, since you likely know your environment, it’s best to change this. I recommend setting to a fixed time like 4:00am if you’re on the East coast of the US, 1:00am on the West coast, or whatever seems to make sense for your audience when you have the least amount of traffic. Setting it to a fixed time each day during low traffic times will minimize the impact and also allow you to troubleshoot easier if you run into any issues. If you have multiple application pools it may be wise to stagger them so that you don’t overload the server with a lot of simultaneous recycles

您可能必须使用应用程序初始化(请参阅 https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-application-initialization)并增加您的空闲超时,以确保您的应用程序对第​​一个用户来说很热。