IIS是否会回收asp.net核心进程? [英] Will IIS recycle the asp.net core process?
问题描述
我需要在asp.net核心应用程序中运行长时间运行的后台任务。
我知道Azure Webjobs和其他过时技术,但是我宁愿使解决方案保持简单,并直接在asp.net核心过程中运行这些任务。
我使用Kestrel,应用程序托管在IIS中。
I need to run long running background tasks in my asp.net core application. I know of Azure Webjobs and other out of process techniques but I'd rather keep the solution simple and runs those tasks directly in the asp.net core process. I use Kestrel and the application is hosted in IIS.
我了解IIS有时会回收IIS进程。
I understand that IIS will occasionally recycle the IIS process. Will it also recycle the asp.net core process?
推荐答案
Asp.Net Core< 2.2
Asp.net Core
在单独的进程 dotnet中运行。 exe
,即使它托管在 IIS
中。但这并不意味着它是作为一个独立的过程运行的。 IIS
仍负责 Asp.net核心
进程( dotnet.exe
)通过 AspNetCoreModule
的生命周期。
Asp.net Core
runs in a separate process dotnet.exe
even when it is hosted in IIS
. But it doesn't mean that it runs as an independent process. IIS
still responsible for Asp.net core
process (dotnet.exe
) life cycle through the AspNetCoreModule
.
因此,答案是肯定的,IIS还将回收asp.net核心进程
So, answer is yes, IIS will also recycle the asp.net core process
Asp .Net Core> = 2.2
Asp.Net Core 2.2在进程中托管$code> IIS和以前的
进程外
托管模型不同。看来,这只是一项优化,可以避免将反向代理请求添加到单独的dotnet进程的额外费用。 IIS将使用 Asp.net Core
应用程序
Asp.Net Core 2.2 has in-process
hosting support on IIS in addition to out-of-process
hosting model that was before. It seems it is just an optimization that allows to avoid the additional cost of reverse-proxying requests over to a separate dotnet process. IIS will recycle application pool with Asp.net Core
application
这篇关于IIS是否会回收asp.net核心进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!