IIS 会回收asp.net core 进程吗? [英] 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 进程.也会回收asp.net核心进程吗?
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
仍然通过AspNetCoreModule
负责Asp.net core
进程(dotnet.exe
)的生命周期.
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 核心 >= 2.2
Asp.Net Core 2.2 除了之前的 进程外
托管模型之外,还对 IIS 提供了 in-process
托管支持.这似乎只是一种优化,可以避免将反向代理请求转移到单独的 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 core 进程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!