How to prevent IIS from shutting down Web Site when not in use?
Asked Answered
R

1

28

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.

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.

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).

Are there other settings which I'm not aware of on the IIS part that causes it to shut down the website automatically?

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.)

Application Pool Settings

I'm on IIS 7.5, Server 2008 R2. It is an ASP.NET 5 Web App.

Roseliaroselin answered 14/3, 2016 at 17:16 Comment(0)
O
54

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. enter image description here

Note: Keeping app pool running all time will consume server's precious memory. It may become critical especially if application is leaking memory.

Ozieozkum answered 14/3, 2016 at 18:3 Comment(3)
Thanks, this resolved my issue. As for memory consumption.. It's alright in my case. This is a critical internal web application that has its own dedicated servers. The most important aspect is keeping it online so that users can quickly access the data at any point during the work hours.Roseliaroselin
Also worth noting is if your web app is doing any background work--say through Hangfire or an IHostedService--that doesn't count as "activity" as far as IIS is concerned, so those will be shut down too, and won't pick up again until there's a new incoming request.Borax
@ChadHedgcock You mean, even after you specify idle time-out = 0? If that is the case, isn't this setting being violated? I see such a case (app pool being suspended) happening for me after I use this setting, and I was trying to figure out why it happens.Vindictive

© 2022 - 2024 — McMap. All rights reserved.