IIS自动启动未禁用空闲超时 [英] IIS Auto-Start not disabling Idle Timeout
问题描述
我在Windows Azure Web角色上设置了ASP.NET自动启动(我在Windows Server 2012上使用ASP.NET 4.5和IIS 8).我基本上遵循这些说明.
I setup ASP.NET Auto-Start on my Windows Azure Web Role (I use ASP.NET 4.5 and IIS 8 on Windows Server 2012). I basically followed those instructions.
我通过webrole的OnStart方法在应用程序池中设置startMode="AlwaysRunning"
,在网站上设置preloadEnabled="true"
.
I am setting startMode="AlwaysRunning"
on the application pool and preloadEnabled="true"
on the website through the OnStart method of the webrole.
我使用了远程访问,并验证了这两个属性的正确设置(通过IIS管理器以及检查applicationHost.config文件).
I used remote access and verified that those two properties are correctly set (through IIS Manager, as well as checking the applicationHost.config file).
我还将此添加到了web.config文件中:
I also added this to the web.config file:
<applicationInitialization skipManagedModules="true">
<add initializationPage="/" />
</applicationInitialization>
此页面表示启用自动启动后应禁用空闲超时".但是,我从日志中看到不是,应用程序池在不活动后重新启动.我还可以在事件日志中看到它(多次超过6个小时):
This page says the Idle Timeout should be disabled when auto-start is enabled. Yet, I can see from my log that it is not, the application pool gets restarted after some inactivity. I can also see that in the event log (several times over 6 hours):
由于不活动,关闭了为应用程序池"cf9d3284-6454-4bbf-8a8e-efd73df4ed83"提供服务的进程ID为"772"的辅助进程.应用程序池超时配置设置为20分钟.需要时将启动一个新的工作进程.
A worker process with process id of '772' serving application pool 'cf9d3284-6454-4bbf-8a8e-efd73df4ed83' was shutdown due to inactivity. Application Pool timeout configuration was set to 20 minutes. A new worker process will be started when needed.
奇怪的是,即使没有网站请求,似乎在登录后也会立即启动一个新的应用程序池.因此,如果我在一小时内未收到单个请求,则应用程序池将被回收并重新启动3次(我从日志中确认了这一点).我的配置不正确还是我缺少什么?
The strange thing is that it seems a new application pool is started immediately after this is logged, even if there is no request to the website. So if I don't get a single request in one hour, the application pool is recycled and restarted 3 times (I confirmed this from the logs). Is my configuration incorrect or am I missing something?
推荐答案
将启动模式"设置为始终单独运行"对我也不起作用,但在应用程序池的高级"设置中将空闲超时"设置为0即可.
Setting the Start Mode to Always Running alone didn't work for me either but setting the Idle Timeout to 0 in the application pool's Advances settings did.
这篇关于IIS自动启动未禁用空闲超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!