Retrace will reach End of Life on March 31, 2027. Click here to learn more.

What is Kestrel Web Server? How It Works, Benefits, and More

By: Alexandra
  |  July 24, 2017
What is Kestrel Web Server? How It Works, Benefits, and More

Kestrel is open-source (source code available on GitHub), event-driven, asynchronous I/O based server used to host ASP.NET applications on any platform. It’s a listening server and a command-line interface. You install the listening server on a Windows or Linux server and the command-line interface on your computer.

It was launched by Microsoft along with ASP.NET Core. All ASP.NET Core apps utilize a new MVC framework and the Kestrel web server. These new apps can run on full .NET Framework or .NET Core. ASP.NET is used on 15% of all websites for which server-side programming languages are known, and as such, it’s important to understand how Kestrel works and the benefits it offers, so that’s why we’ve decided to take a closer look at this web server in today’s post.

A Definition of the Kestrel Web Server

Kestrel is considered a preferred web server for newer ASP.NET applications (see this post for a comparison to IIS and why you need both). It is based on the libuv library, the same one used by node.js. Libuv supports an event-driven style of programming. Some of its core utilities include:

  • Non-blocking network support
  • Asynchronous file system access
  • Timers
  • Child processes

It allows ASP.NET Core applications to be run easily on other cross-platform webservers such as Nginx and Apache, without the need to address varying startup configurations. By using Kestrel as an in-process server, applications will have a consistent process (Startup (Main(), Startup.ConfigireServices(), Startup.Configure()) ) even with cross-platform support.

How Kestrel Web Server Works

Applications are often written to respond to human actions. With event-driven programming, there is a loop that listens for events. It then triggers a callback function. To reduce the number of SYS calls, all other work is executed in managed code on standard .NET worker threads.

Kestrel provides an event loop and callback-based notifications of I/O. Libuv manages the gathering and monitoring of events from the OS. Moreover, the user can register callbacks as an event occurs. So, Kestrel uses libuv for I/O work and supports running multiple event loops.

Because it is so lightweight, Kestrel does not allow you to do SSL termination, URL rewrites, or GZip compression, but that same lightweight design can make other web servers look slow by comparison. It was built to be fast; in fact, it’s six times faster than node.js for static and plain text operations.

Benefits of Kestrel

Kestrel has support on all platforms and versions supported by .NET Core. Furthermore, it is included by default in ASP.NET Core new project templates and can provide better request processing performance. When you create a new project in Visual Studio, your project is automatically configured to run in Kestrel.

As stated earlier, it’s not a fully-featured web server, but that’s precisely why it’s fast. If you feel the need for speed, Kestrel is the answer–especially since it is designed to be used in production for ASP.NET.

What you can do is run it behind a more fully-featured webserver such as IIS or NGINX. You can run it behind IIS using the HttpPlatformHandler or behind IIS Express using HttpPlatformHandler by Visual Studio. Moreover, you’ll want to support it in your ASP.NET Core projects so that they can be conveniently run by developers on any of the supported platforms.

Now, even if you are not working cross-platform, you can run ASP.NET on a web server straight from the command line.

Since Kestrel is not a fully-featured web server, you should run it behind IIS or NGINX. It was designed to make ASP.NET as fast as possible but is limited in its ability to manage security and serve static files. If you’re using ASP.NET Core with Kestrel, you can take advantage of Prefix for powerful code profiling.

Additional Resources and Tutorials

For more information, including some helpful tutorials, visit the following resources:

Improve Your Code with Retrace APM

Stackify's APM tools are used by thousands of .NET, Java, PHP, Node.js, Python, & Ruby developers all over the world.
Explore Retrace's product features to learn more.

Learn More
indobet toto slot toto toto bobatoto daftar logototo patentoto toto bayitoto popotogel prize hongkong malam ini joker11 lingkartoto depo 5k https://nolimithoki.dev/ dinasti33 slot slot jepang toto toto flokitoto slot gacor logototo slot depo 5k bobatoto bobatoto bobatoto sontogel mpo slot situs toto slot situs slot bobatoto kari4d kari4d kari4d kari4d pascol4d pascol4d pascol4d bento11 link slot gacor toto toto slot toto situs slot situs slot situs slot https://www.asupan188.dev/ slot gacor gampang menang toto slot gacor bwo303 situs toto toto slot slot gacor slot88 slot gacor situs slot link slot slot gacor pucuk4d PASCOL4D situs slot link slot slotvip situs toto toto slot situs slot situs slot situs slot toto slot gacor slot777 situs judi bola POPOTOGEL : Situs Resmi Bandar Toto Togel Macau dengan Prediksi Gokil Pasti Akurat link slot slot gacor situs slot slot gacor slot gacor situs slot link slot gacor Slot88 Slot88 slot gacor situs toto toto slot pulsa slot777 link slot gacor situs gacor slot gacor slot gacor slot gacor slot gacor Slot88 situs slot slot gacor Slot88 slot gacor slot terbaru slot gacor situs slot slot gacor situs slot Situs Slot POPOTOGEL: Regulasi Bandar Situs Togel Resmi & Bola Mix Parlay Asia Terpercaya StreamEast slot resmi slot slot resmi slot bayitoto link gacor slot gacor kari4d slot gacor slot gacor slot gacor pascol4d kari4d AMANAHTOTO kari4d bragatoto slot gacor slot game pucuk4d rokokbet rokokbet kari4d pascol4d LOGIN PASCOL4D pucuk4d roma77 judi bola slot depo 10k mpo slot Girang4d KARI4D StreamEast AMANAHTOTO jutatoto PARLAY slot88 slot depo 5k hoki99 pascol4d pkv games roma77 Slot poker slot situs slot PREMANTOTO AMANAHTOTO AMANAHTOTO AMANAHTOTO dominoqq vespa36 kari4d vespa36 leon188 leon188 vespa36 gacor mpo login TOTO SLOT hoki99 KENANGAN889 KENANGAN889 KENANGAN889 KARI4D parlay parlay parlay KENANGAN889
indobet toto slot toto toto bobatoto daftar logototo patentoto toto bayitoto popotogel prize hongkong malam ini joker11 lingkartoto depo 5k https://nolimithoki.dev/ dinasti33 slot slot jepang toto toto flokitoto slot gacor logototo slot depo 5k bobatoto bobatoto bobatoto sontogel mpo slot situs toto slot situs slot bobatoto kari4d kari4d kari4d kari4d pascol4d pascol4d pascol4d bento11 link slot gacor toto toto slot toto situs slot situs slot situs slot https://www.asupan188.dev/ slot gacor gampang menang toto slot gacor bwo303 situs toto toto slot slot gacor slot88 slot gacor situs slot link slot slot gacor pucuk4d PASCOL4D situs slot link slot slotvip situs toto toto slot situs slot situs slot situs slot toto slot gacor slot777 situs judi bola POPOTOGEL : Situs Resmi Bandar Toto Togel Macau dengan Prediksi Gokil Pasti Akurat link slot slot gacor situs slot slot gacor slot gacor situs slot link slot gacor Slot88 Slot88 slot gacor situs toto toto slot pulsa slot777 link slot gacor situs gacor slot gacor slot gacor slot gacor slot gacor Slot88 situs slot slot gacor Slot88 slot gacor slot terbaru slot gacor situs slot slot gacor situs slot Situs Slot POPOTOGEL: Regulasi Bandar Situs Togel Resmi & Bola Mix Parlay Asia Terpercaya StreamEast slot resmi slot slot resmi slot bayitoto link gacor slot gacor kari4d slot gacor slot gacor slot gacor pascol4d kari4d AMANAHTOTO kari4d bragatoto slot gacor slot game pucuk4d rokokbet rokokbet kari4d pascol4d LOGIN PASCOL4D pucuk4d roma77 judi bola slot depo 10k mpo slot Girang4d KARI4D StreamEast AMANAHTOTO jutatoto PARLAY slot88 slot depo 5k hoki99 pascol4d pkv games roma77 Slot poker slot situs slot PREMANTOTO AMANAHTOTO AMANAHTOTO AMANAHTOTO dominoqq vespa36 kari4d vespa36 leon188 leon188 vespa36 gacor mpo login TOTO SLOT hoki99 KENANGAN889 KENANGAN889 KENANGAN889 KARI4D parlay parlay parlay KENANGAN889