如何防止IIS在不使用时关闭网站? [英] How to prevent IIS from shutting down Web Site when not in use?
问题描述
我在IIS下托管了一个Web应用程序。它是一个数据仓库,在启动过程中需要在内存中实例化大量项目(大约需要20分钟才能完全设置)。由于此网站对我们公司至关重要,因此该系统必须在白天在线100%,并且只能在下班时间重新启动。
I have a web application hosted under IIS. It is a data warehouse, and during its startup process it requires instantiating a large set of items in memory (takes roughly ~20 minutes to fully set up). Because this website is critical to our company, this system must be online 100% during the daytime, and only can be restarted during off-work hours.
出于某种原因,当一段时间没有使用时,这个Web应用程序似乎是离线的。我知道这一点,因为访问网站时缓存未完全实例化。这是不可接受的。
For some reason, this web application seems to be "offline" when there is no usage for some time. I know this because the cache is not fully instantiated when the website is visited. This is unacceptable.
我不清楚为什么该网站被关闭。应用程序池仅设置为每天凌晨4:00(现在是上午11点)进行回收。
It is not clear to me why the website is shut off. The application pool is only set to recycle daily at 4:00 AM (it is 11 AM now).
IIS部件上是否还有其他我不知道的设置导致它自动关闭网站?
Are there other settings which I'm not aware of on the IIS part that causes it to shut down the website automatically?
Addl注意:在Visual Studio中的 IISExpress 中运行时,网站不会自动关闭。只有IIS上托管的生产版本才会关闭。
Addl Note: The website does not shut off automatically when running in IISExpress in Visual Studio. Only the production version hosted on IIS shuts off.
这是运行网站的应用程序池的高级设置屏幕。 (不确定它是否有用。)
Here's a screen of the Advanced Settings for the Application Pool the web site is running under. (Not sure if it's useful.)
I我在IIS 7.5,Server 2008 R2上。它是一个ASP.NET 5 Web应用程序。
I'm on IIS 7.5, Server 2008 R2. It is an ASP.NET 5 Web App.
推荐答案
检查屏幕截图中流程模型下的空闲超时设置。该设置导致应用程序池在闲置20分钟后关闭。您可以将其设置为0以使其始终保持运行,即使它处于空闲状态,即不处理任何请求。
Check Idle Time-out settings under process model in screenshot. That setting is causing app pool shutting down when remain idle for 20 mins. You can set it to 0 to keep it running all time even when its idle i.e. not processing any requests.
注意:保持应用程序池一直运行将消耗服务器的宝贵内存。如果应用程序泄漏内存,它可能会变得至关重要。
Note: Keeping app pool running all time will consume server's precious memory. It may become critical especially if application is leaking memory.
这篇关于如何防止IIS在不使用时关闭网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!