Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net Core on Windows vs Linux

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?

like image 433
Piersdb Avatar asked Jun 02 '17 17:06

Piersdb


People also ask

Is .NET Core faster on Linux?

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).

Can .NET Core work on Linux?

NET Core runtime allows you to run applications on Linux that were made with .

Is .NET Core really cross-platform?

NET Core is cross-platform. It runs on Windows, OS X and multiple distributions of Linux. It also supports different CPU architectures.


2 Answers

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% 
like image 133
pulsejet Avatar answered Sep 20 '22 23:09

pulsejet


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.

like image 40
TerribleDev Avatar answered Sep 21 '22 23:09

TerribleDev