madcyree
madcyree

Reputation: 1457

IIS vs Kestrel performance comparison

How does the performance of IIS look like comparing to a Kestrel http server?

Seems like Kestrel is significantly inspired by the family of asynchronous and event-driven server frameworks. In the meantime, IIS has a long history of development and obviously more mature in terms of features. Taking all that into account, I'm specifically looking for a comparison of memory utilization, thread utilization, request related comparison (like request-per-second) and streaming capabilities.

Upvotes: 31

Views: 30807

Answers (5)

Matias Quaranta
Matias Quaranta

Reputation: 15593

Here is the XSLX file from the GitHub repo where you can see the performance comparisson you are looking for.

Open the file on Excel and check the "Latest" tab. enter image description here

Update: The excel file is no longer available and has been replaced with an interactive Power BI dashboard.

Upvotes: 20

René Schindhelm
René Schindhelm

Reputation: 139

As for why in-process hosting in IIS is faster (taken straight from the docs):

Using in-process hosting, an ASP.NET Core app runs in the same process as its IIS worker process. In-process hosting provides improved performance over out-of-process hosting because requests aren't proxied over the loopback adapter, a network interface that returns outgoing network traffic back to the same machine.

See Hosting Models.

Upvotes: 2

DeepSpace101
DeepSpace101

Reputation: 13722

As of Nov 2016, straight from the ASP.NET benchmarks.

On Windows Server 2012, at a pipeline depth of 16:

stack        on       RT        requests/sec
ASP.NET 4.6  IIS      CLR           57,792 
ASP.NET 5    Kestrel  CoreCLR    1,188,521       

That's a 20x or 2000% speedup. I understand a full blown IIS vs standalong Kestrel but I do hope someone on the ASP.NET team can deep dive on this because the difference is tremendous.

That and why it's so much slower on Linux.

benchmark results

Upvotes: 5

Milan Vidakovic
Milan Vidakovic

Reputation: 466

I did quite a bit of benchmarking for my current project, hosting both .net core 1.0 and 2.0 apps on IIS and Kestrel. The tests were real-world rest-api CRUDs with authentication/authorization, logging, metrics, rate limiting etc. Also, .net core apps were done completely by the MS book, complying to recommended 1.0/2.0 standards.

With the same hardware setups, hosting behind IIS constantly served around 40% more requests per second. I'm still unable to find an article or a consultant who is able to explain the performance difference.

I also tried to find any sort of optimization tips from the core benchmarking authority https://github.com/aspnet/benchmarks, by rummaging through settings and service initializers, but still, IIS was just faster.

Any pointers?

Upvotes: 7

bbqchickenrobot
bbqchickenrobot

Reputation: 3709

Here are some preliminary Kestrel benchmarks by the asp.net team. While not as exhaustive as what you were looking for you will find they post some information regarding RPS. I'm sure more will come as they get closer to a release. IIS benchmarks you can find on the internet with a simple google search:

https://github.com/aspnet/benchmarks

Upvotes: 0

Related Questions