Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopping website in IIS also stops application pool #6747

Open
DamienLaw opened this issue Jul 19, 2023 · 3 comments
Open

Stopping website in IIS also stops application pool #6747

DamienLaw opened this issue Jul 19, 2023 · 3 comments
Labels
Milestone

Comments

@DamienLaw
Copy link

DamienLaw commented Jul 19, 2023

As per my understanding about IIS, stopping a website would still allow the application pool to continue running. Stopping the website merely just stops listening for requests but the worker process will still be active.

However, using ABP 8.1.0 with .NET 7, stopping the website also stops the entire application. The following is obtained from the log.

DEBUG 2023-07-19 14:56:19,592 [19   ] Abp.AspNetCore.SignalR.Hubs.AbpCommonHub - A client is disconnected: 4zhQNFHgJFYJQgZtEo9wgA
DEBUG 2023-07-19 14:56:19,596 [22   ] Abp.Modules.AbpModuleManager             - Shutting down has been started
INFO  2023-07-19 14:56:19,596 [7    ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint '/signalr'
DEBUG 2023-07-19 14:56:19,597 [22   ] Abp.BackgroundJobs.BackgroundJobManager  - Stop background worker: Abp.BackgroundJobs.BackgroundJobManager
INFO  2023-07-19 14:56:19,597 [19   ] Microsoft.AspNetCore.Hosting.Diagnostics - Request finished HTTP/1.1 GET https://bravo.bytedash.test/signalr?id=4zhQNFHgJFYJQgZtEo9wgA - - - 101 - - 14451.0015ms
DEBUG 2023-07-19 14:56:19,597 [22   ] , Culture=neutral, PublicKeyToken=null]] - Stop background worker: Abp.Authorization.Users.UserTokenExpirationWorker`2[[ByteDash.TestProject.MultiTenancy.Tenant, ByteDash.TestProject.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[ByteDash.TestProject.Authorization.Users.User, ByteDash.TestProject.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
DEBUG 2023-07-19 14:56:19,597 [22   ] Abp.BackgroundJobs.BackgroundJobManager  - WaitToStop background worker: Abp.BackgroundJobs.BackgroundJobManager
DEBUG 2023-07-19 14:56:19,597 [22   ] , Culture=neutral, PublicKeyToken=null]] - WaitToStop background worker: Abp.Authorization.Users.UserTokenExpirationWorker`2[[ByteDash.TestProject.MultiTenancy.Tenant, ByteDash.TestProject.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[ByteDash.TestProject.Authorization.Users.User, ByteDash.TestProject.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
DEBUG 2023-07-19 14:56:19,598 [22   ] Abp.Modules.AbpModuleManager             - Shutting down completed.
INFO  2023-07-19 14:56:19,598 [22   ] Microsoft.Hosting.Lifetime               - Application is shutting down...

Anyone knows anything about this? Is it by design?
Thank you.

@ismcagdas ismcagdas added this to the Backlog milestone Oct 9, 2023
@SteveArr
Copy link

I am an old IIS administrator, so this is coming from memory:

If an Application Pool only has one website and that website stops then the Application Pool will shut down. To prevent this, you can set the 'start mode' for the Application Pool to "Always Running".

@afonsoft
Copy link
Contributor

afonsoft commented Feb 27, 2024

Change de Web.Config

put

startupTimeLimit="3600" requestTimeout="23:00:00" hostingModel="outofprocess"

My Web.config for IIS


<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<system.web>
		<httpCookies httpOnlyCookies="true" requireSSL="true" />
	</system.web>
	<system.webServer>
		<modules runAllManagedModulesForAllRequests="true">
			<remove name="WebDAVModule" />
		</modules>
		<handlers>
			<remove name="aspNetCore" />
			<remove name="WebDAV" />
			<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
			<remove name="OPTIONSVerbHandler" />
			<remove name="TRACEVerbHandler" />
			<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
		</handlers>
		<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\wwwroot\Logs\stdout" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00" hostingModel="outofprocess">
			<environmentVariables>
				<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="LOCAL" />
			</environmentVariables>
			<handlerSettings>
				<handlerSetting name="debugFile" value=".\wwwroot\LOGS\aspnetcore-debug.log" />
				<handlerSetting name="debugLevel" value="ERROR" />
			</handlerSettings>
		</aspNetCore>
		<httpErrors errorMode="Detailed" existingResponse="PassThrough" />
		<asp scriptErrorSentToBrowser="true" />
		<security>
			<requestFiltering>
				<requestLimits maxAllowedContentLength="2147483647" />
			</requestFiltering>
		</security>
		<httpProtocol>
			<customHeaders>
				<remove name="X-Powered-By"/>
				<remove name="X-Powered-By-Plesk"/>
			</customHeaders>
		</httpProtocol>
	</system.webServer>
</configuration>

@DamienLaw
Copy link
Author

Change de Web.Config

put

startupTimeLimit="3600" requestTimeout="23:00:00" hostingModel="outofprocess"

My Web.config for IIS


<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<system.web>
		<httpCookies httpOnlyCookies="true" requireSSL="true" />
	</system.web>
	<system.webServer>
		<modules runAllManagedModulesForAllRequests="true">
			<remove name="WebDAVModule" />
		</modules>
		<handlers>
			<remove name="aspNetCore" />
			<remove name="WebDAV" />
			<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
			<remove name="OPTIONSVerbHandler" />
			<remove name="TRACEVerbHandler" />
			<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
		</handlers>
		<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\wwwroot\Logs\stdout" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00" hostingModel="outofprocess">
			<environmentVariables>
				<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="LOCAL" />
			</environmentVariables>
			<handlerSettings>
				<handlerSetting name="debugFile" value=".\wwwroot\LOGS\aspnetcore-debug.log" />
				<handlerSetting name="debugLevel" value="ERROR" />
			</handlerSettings>
		</aspNetCore>
		<httpErrors errorMode="Detailed" existingResponse="PassThrough" />
		<asp scriptErrorSentToBrowser="true" />
		<security>
			<requestFiltering>
				<requestLimits maxAllowedContentLength="2147483647" />
			</requestFiltering>
		</security>
		<httpProtocol>
			<customHeaders>
				<remove name="X-Powered-By"/>
				<remove name="X-Powered-By-Plesk"/>
			</customHeaders>
		</httpProtocol>
	</system.webServer>
</configuration>

You're saying that outofprocess is the only way to keep the app pool running after a website is stopped?
I tried with other non-ABP ASP.NET Core websites running in-process and still able to keep app pool running after the website is stopped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants