用于Asp.Net Core的Kestrel Web服务器-是否在一段时间后回收/重新加载 [英] Kestrel webserver for Asp.Net Core - does it recycle / reload after some time

查看:346
本文介绍了用于Asp.Net Core的Kestrel Web服务器-是否在一段时间后回收/重新加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单的菜鸟问题:-)

我将使用在Digitalocean的小滴中托管的小型.NET核心应用程序宿主进行生产.我一直使用IIS托管网站,但我想转到Linux发行版,并使用nginx作为反向代理.

I'm about to go into production with a small .NET core app host that's hosted in a droplet at digitalocean. I've always hosted websites using IIS, but I would like to move to linux distributions and use nginx as reverse proxy.

我的问题就是标题所说的:-)茶Does是否像IIS一样需要回收应用程序池"?如果不是,那是否意味着从Kestrel加载的应用程序一直在线,直到关闭为止?

My question is as the title says :-) Does kestrel every need to recycle a "application pool" like the IIS does? If not, does that mean the application is loaded from Kestrel is online until it's shut down?

最诚挚的问候 詹斯

推荐答案

基于观看和观看所有 http://live.asp.net 社区站立会议我不会,Kestrel不会像IIS那样自我回收.

Based on bits of information here and there from watching all the http://live.asp.net Community Standup meetings I'd so no, Kestrel does not recycle itself the way IIS does.

这样做的原因是,如果Kestrel停止,它目前无法重启.这就是为什么将它放在某种反向代理(如IIS或nginx)中很重要的众多原因之一.目前,这种过程生命周期管理功能必须来自Kestrel外部的软件层.如果Kestrel因软件错误或其他原因而死,并且没有反向代理或其他进程来重新启动它,它将不会自行重新启动,并且网站将保持关闭状态.

The reason for this is that Kestrel currently has no way to restart itself if it stops. That's one of the many reasons why it's important to put it behind some sort of reverse proxy like IIS or nginx. This kind of process lifetime management functionality must currently come from a software layer outside of Kestrel. If Kestrel dies due to a software bug or other reason and there is no reverse proxy or other process to restart it, it will not restart by itself and the website will be stay down.

有关其他信息,本文讨论了发布到Linux生产环境,并包括一个具有Restart=always

For additional information, this article talks about Publishing to a Linux Production Environment and includes an example nginx system service file that has Restart=always https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction

这篇关于用于Asp.Net Core的Kestrel Web服务器-是否在一段时间后回收/重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆