闲置时,Hangfire服务器会休眠

问题描述

我已将应用程序池设置为:

StartMode-始终运行| 空闲超时(分钟)0 | Preload Enanbled = true

我不明白为什么我的Hangfire应用程序仍然休眠。另外,在我打开hangfire应用程序之后,服务器是在第二天启动的。有什么建议解决这个问题吗?

enter image description here

解决方法

为Windows进程激活(WAS)和万维网发布(W3SVC)服务启用自动启动(默认情况下启用)。

运行以下命令,将serviceAutoStartEnabled =“ true”设置为您的站点:

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/sites/site[@name='appname']/applicationDefaults" -name "serviceAutoStartEnabled" -value "True"

确保已禁用应用程序池回收:

enter image description here

在“回收”下,将“常规时间间隔”(分钟)设置为0。

enter image description here

选择“特定时间”,然后单击>扩展箭头以查看下面是否指定时间,或单击...以查看“ TimeSpan集合编辑器”对话框中是否有任何值。如果是这样,请清除它。

enter image description here

请参阅此帖子以获取更多详细信息:

IIS 10 Application Pool fall a sleep