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 .