Kestrel is the cross-platform web server that comes built-in with ASP.NET Core. Itβs designed to:
Serve HTTP requests directly using managed code.
Run on Windows, Linux, and macOS .
Deliver high performance using asynchronous I/O .
Integrate seamlessly with reverse proxies such as IIS , Nginx , or Apache .
π‘ Why Kestrel?
Before .NET Core, applications ran exclusively on IIS . But .NET Coreβs goal was cross-platform flexibility β hence Kestrel became the default server for all ASP.NET Core applications.
βοΈ Architecture Overview
Kestrel uses:
Managed sockets (previously libuv
for cross-platform I/O).
A highly optimized request/response pipeline built on top of System.IO.Pipelines
.
Asynchronous task-based I/O for non-blocking performance.
Connection middleware to support protocols (HTTP/1.x, HTTP/2, and HTTP/3 with QUIC).
Kestrel can handle millions of concurrent requests efficiently β making it ideal for microservices , APIs , and real-time applicationss .