.net Core on Windows vs Linux

Viewed 16513

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?

3 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%

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? :)

Related