Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kestrel webserver for Asp.Net Core - does it recycle / reload after some time

Simple noob question :-)

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.

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?

Best regards Jens

like image 669
dev1985 Avatar asked Mar 29 '17 15:03

dev1985


1 Answers

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.

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.

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

like image 176
RonC Avatar answered Sep 21 '22 17:09

RonC