phhbr
phhbr

Reputation: 2727

ASP.NET MVC 5 webpage on IIS 8.5 always going to idle

I have an ASP.NET MVC 5 webapplication hosted @ IIS 8.5 / Windows Server 2012 R2.

For the application pool I have the following custom configuration parameters set

preloadEnabled = "true"
startMode = "AlwaysRunning"
idleTimeout = 0

The web application terminates still after ~20 minutes without requests and it takes ~30 seconds for it to be available again.

Is there any another option I forgot to adjust/turn on/off?

Upvotes: 5

Views: 669

Answers (1)

Bill Sambrone
Bill Sambrone

Reputation: 4454

I'm running IIS 7.5 on Server 2008R2, but our situation should be similar. I also wanted "always running" and didn't want w3wp.exe to die after idle. My issue was that preload wasn't firing, so your mileage may vary with the below.

Your app pool stuff looks good. I would also add that you should turn off recycling if a live forever application is your goal. Let's confirm that the settings are getting to the right spots!

  • Open up IIS and click on your computer (or the hostname of the webserver in question). In the right pane under the management area, click on Configuration Editor.
  • In the "section" drop down, pick system.applicationHost/applicationPools. The first item is a probably a collection where count=something. Click that row to get the ... elipsis to show up then click that.
  • Click your application pool and make sure you don't see 20 minutes anywhere in here. You'll need to expand the processModel node to see it. Also make sure startMode is always running.
  • Do bullets 1 & 2 again, but this time go to sysetem.applicationHost/sites. Hit the ellipsis on the first item to see your sites and click on the one you care about.
  • In the bottom pane you'll see yet another collection item at the top. Go into that. Pick your application that you want to live forever. Check out the auto start and preload stuff and make sure both are set to True.

Upvotes: 1

Related Questions