question

barahonajmc avatar image
0 Votes"
barahonajmc asked ·

Should we use IIS for ASP.NET core 5.0 apps on production

There is certainly a lot of information related on how to deploy asp.net core application on IIS but I fail to find answer to my essential question, should we still using and planning the deployment of our apps with ISS?


Scenario: I have a bunch of applications I want to run from a machine running latest windows server


  • Is it recommended to use IIS server (I would assume using it only as a reverse proxy)?

  • How is YARP coming into the picture? would it replace IIS as reverse proxy?

  • Or should I use TYE and plan the deployment of the apps to Kubernetes?


Note: There probably won't be a simple answer since all options seems to be acceptable, but I would like to hear (read) your thoughts on this


windows-server-iis-generaldotnet-aspnetcore-general
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@barahonajmc,
it is recommended to use IIS,you can refer to the link,it says 'In-process hosting provides improved performance over out-of-process hosting because requests aren't proxied over the loopback adapter'.


1 Vote 1 ·

1 Answer

WadeGausdenNZ avatar image
1 Vote"
WadeGausdenNZ answered ·

To answer your question somewhat broadly, it really depends on any limitations in Kestrel, that could be solved using IIS. If you are talking about IIS vs something like Nginx, again, it's really about feature comparison. You can host applications on Kestrel, IIS, or things like Nginx. It really just depends on your actual requirements.

In particular to what you need

I have a bunch of applications I want to run from a machine running latest windows server

This wouldn't work with Kestrel (easily) because Kestrel binds an IP and port to an application. You couldn't for example bind multiple applications to the same IP and port, which obviously inside IIS is trivial. For other IIS vs Kestrel type issues, you can have a read here : https://dotnetcoretutorials.com/2019/12/25/kestrel-vs-iis/

You mentioned

IIS as reverse proxy

Again, this is totally dependant on your requirements. But as the comment mentioned, IIS can operate as a reverse proxy (out-of-process), or actually have the .NET Core app run inside IIS itself (in-process). Operating as a reverse proxy, IIS (And other reverse proxies like Nginx), may see a performance hit because it's that one extra hop, and again, it's totally dependant on your actual feature requirements and what you need.

Based on all of the information. It sounds like if you need to run multiple applications from the single machine, then running IIS in the "in-process" mode (Which is now the default for .NET Core 3.X) seems like a good idea.

For other information about running .NET Core inside IIS, and the whole In-Process vs Out-Of-Process debacle, here's an article to help : https://dotnetcoretutorials.com/2019/12/23/hosting-an-asp-net-core-web-application-in-iis/

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.