Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core randomly restarts under IIS

We found a problem, ASP.NET Core application on some servers randomly restarts every day at random times.

  • Windows Server 2012 R2 Standard, IIS 8.5.9600.16384
  • Hosting bundle Microsoft.NETCore.App 2.1.4, Microsoft.AspNetCore.App 2.1.4
  • Out of process hosting model
  • Application pool recycling is disabled

In Event Viewer In Application Section

Application 'MACHINE/WEBROOT/APPHOST/APPLICATIONNAME' started process 'xxx' successfully and is listening on port 'xxx'. (Event ID 1001)

Sent shutdown HTTP message to process '6860' and received http status '202'. (Event ID 1006)

App_offline file 'app_offline.htm' was detected (Event ID 1012)

And in System Section at same time

The TCP/IP NetBIOS Helper service entered the running state. (Event ID 7036)

The TCP/IP NetBIOS Helper service entered the stopped state. (Event ID 7036)

The TCP/IP NetBIOS Helper service was successfully sent a stop control. The reason specified was: 0x40030011 [Operating System: Network Connectivity (Planned)] Comment: None (Event ID 7042)

All events happen in 2-3 seconds

like image 473
Daniil Sokolyuk Avatar asked Dec 13 '18 17:12

Daniil Sokolyuk


People also ask

Why does IIS need to be restarted?

The IIS restart command was needed for restarting the web server process to resolve performance issues that may have developed in the application.

What happens when IIS application pool recycle?

What is application pool recycling in IIS? Recycling means that the worker process that handles requests for that application pool is terminated and a new one is started. This is generally done to avoid unstable states that can lead to application crashes, hangs, or memory leaks.

Does restarting IIS restart app pool?

All replies. IISreset resets all application pools. Application pools are used to seperate processes. In earlier versions we always had to reset IIS, and so resetting ALL websites.

How do I automatically restart application pool in IIS?

Configuring Auto-Start with IIS ManagerIn the Connections pane, select the Application Pools node, revealing the Application Pools pane in the main view. Select the application pool for which you wish to enable Auto-Start. Locate the Start Mode option under the General group and set it to AlwaysRunning. Click OK.


1 Answers

It sounds like you have periodicRestart configured on IIS. https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/recycling/periodicrestart/ I think the default interval is 29 hours. Disable this setting.

like image 158
No Refunds No Returns Avatar answered Oct 05 '22 01:10

No Refunds No Returns