28

ASP.Net Core runs on both Windows and Linux Docker containers. Considering Linux hosts are cheaper than Windows hosts, what is the benefit of running your app on IIS/Windows vs Nginx/Linux if one doesn't require the full .Net framework?

1
  • @LexLi Side-by-side is supported on all platforms by .NET Core
    – omajid
    Jun 6, 2017 at 11:55

3 Answers 3

38

A study by Roberto Prevato suggests that you'll be better off running it on Linux (!), at least for ASP.NET Core.

Results are consistent with those obtained generating load from a computer connected through wire to the internet: the same ASP.NET Core application deployed in Linux and Docker is much faster than one deployed in Windows host (both inside Application Service Plan). These new tests show an even stronger dominance of the application hosted in Linux, especially when serving responses with bigger bodies.

A short summary of the results he got:

Requests per second (higher is better):

Scenario        Linux   Windows  +% 
Hello World     646.6   432.85  +49.38%
1KB             623.05  431.95  +44.24% 
10KB            573.6   361.9   +58.5% 
50KB            415.5   210.05  +97.81% 
100KB           294.35  143.25  +105.48%

Response Time (lower is better):

Scenario        Linux   Windows  -%
Hello World     168.85  242.2   -30.28%
1KB             171.25  249.8   -31.45%
10KB            184.2   292.7   -37.07%
50KB            233.3   542.85  -57.02%
100KB           365.05  817.35  -55.34%
3

There is no clear cut benefit. This is the same argument as why would you want to run rails, jboss, on other platforms. Since you are running the same app, there are not many considerations to account for. There are features in windows that you may wish to have such as dns caching. Of if you would prefer to use web listener, and not kestrel, but that would have to largely depend on what you are doing.

If you really care about your http transports, or which timezone database .net will use, then you can make such a determination. For most users, there is not a major benefit. If you wish to have AD login's then you pretty much have to use windows, and IIS, since you need a server that is part of the active directory domain.

Just remember, linux does have a free option, but most paid enterprise support for linux is usually the same, if not more expensive than windows.

1
  • 1
    The features that you are highlighting such as "There are features in windows that you may wish to have such as dns caching." can easily be implemented in Linux. If the benchmark above are comparing apples against apples, then the numbers are relevant.
    – Tk421
    Nov 27, 2020 at 0:40
0

Most of the performance tests conducted recently would beg to differ. A 50% RPS difference is clear cut. There are definitely niche differences, such as native AD support, though openAD would facilitate that on Linux, for people with the experience to set it up. Given the performance test results, and the fact that Linux offers easier and generally more secure production deployments, I'm curious what reasons people might need to choose windows. A same-server Sharepoint integration? :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.