I have a Windows Server 2016 machine running IIS 10.0. It hosts a number of application pools. One pool in particular restarts itself randomly. It is a heavily used pool and this disruption is a problem for us. We notice this restart because the site becomes somewhat unresponsive while clients re-authenticate including hundreds of reloaded ASP sessions, and thousands of SignalR connections. Then things go back to normal. We need to figure out why the site is reloading so we can fix whatever problem it is.
Things we have tried, and potential causes of the restart we've eliminated:
- It is not an idle timeout. The site is in heavy use and idle timeout is disabled.
- It is not an automatic daily recycle. This is disabled.
- We do not believe it to be a file configuration change such as web.config or something in the \bin folder. We added
fcnMode="Disabled"in the web.config to stop this and have seen no effect. Other sites are not reloading so it's not some kind of global IIS file change. - There are no events in Windows Event log pertaining to this in any category. It's like no error occurred. Or it wasn't something that gets logged.
- The log files in inetpub\logs\LogFiles\W3SVC1 and iislogs\www\HTTPERR have no information we can find related to these restarts.
I want to clarify that the process is not killed and does not crash. The uptime on the w3wp executable hosting this pool doesn't go back to zero. It's more like a recycle. It happens 3-6 times per day.
What could we do to find the cause? Any logging we could enable - whether it be an error or a graceful "on-purpose" restart?
Edit: - We found and added a log on the System.Web.Hosting.HostingEnvironment.ShutdownReason and we're hopeful that will help. Leaving the question open for any other ideas.
Based on my experience, if your application pool restart automatically, it is because that this site utilize high CPU usage on the server so the IIS will automatically recycle your application pool. Have you checked your application and check your IIS settings that you don't place any limit on your site?