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
situs toto pucuk4d agb99 toto slot toto togel indobet situs toto toto slot toto slot toto slot toto slot depo 10k 8kuda4d judi bola toto situs toto toto toto situs toto toto toto slot bobatoto daftar logototo situs toto situs toto toto bydplay patentoto situs toto slot 4D situs toto leon188 situs toto slot gacor terbaru toto toto situs toto situs toto ilmutoto mix parlay bayitoto mawar800 login popotogel prize hongkong malam ini toto joker11 toto slot lingkartoto UGSLOT slot gacor ilmutoto https://foundvinylrecords.com/ depo 5k slot gacor panen100 semibola MySlot188 monk4d popo togel https://asupantoto.co/ pompa4d slot pascol4d login pascol4d login sbobet88 sbobet88 https://nolimithoki.dev/ ini777 dinasti33 slot slot gacor kaskustoto situs toto slot88 slot jepang slot depo 5k pucuk4d https://www.juara288.asia/ https://shopjoliboutique.com/ apo388 slot 4d RP888 toto toto toto toto toto slot gacor toto pascol4d situs toto kari4d flokitoto slot gacor logototo slot depo 5k bobatoto bobatoto bobatoto slot gacor sontogel PASCOL4D LOGIN mpo slot sumbartoto mataramtoto slot gacor situs toto slot situs slot situs toto pakde4d link slot sumbartoto Login bandar toto popotogel login slot gacor nobu99 situs toto logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo Slot Malaysia bobatoto istanaslot sumbartoto mataramtoto meteorbet88 login 33ag rp888 AMANAHTOTO www.pajaktoto.io kari4d kari4d kari4d kari4d pascol4d pascol4d pascol4d situs toto toto slot situs slot slot ilmutoto toto toto slot SLOT GACOR slot gacor slot bento11 link slot gacor AMANAHTOTO KARI4D PUCUK4D pascol4d situs slot situs slot toto slot titi4d ilmutoto situs toto
situs toto pucuk4d agb99 toto slot toto togel indobet situs toto toto slot toto slot toto slot toto slot depo 10k 8kuda4d judi bola toto situs toto toto toto situs toto toto toto slot bobatoto daftar logototo situs toto situs toto toto bydplay patentoto situs toto slot 4D situs toto leon188 situs toto slot gacor terbaru toto toto situs toto situs toto ilmutoto mix parlay bayitoto mawar800 login popotogel prize hongkong malam ini toto joker11 toto slot lingkartoto UGSLOT slot gacor ilmutoto https://foundvinylrecords.com/ depo 5k slot gacor panen100 semibola MySlot188 monk4d popo togel https://asupantoto.co/ pompa4d slot pascol4d login pascol4d login sbobet88 sbobet88 https://nolimithoki.dev/ ini777 dinasti33 slot slot gacor kaskustoto situs toto slot88 slot jepang slot depo 5k pucuk4d https://www.juara288.asia/ https://shopjoliboutique.com/ apo388 slot 4d RP888 toto toto toto toto toto slot gacor toto pascol4d situs toto kari4d flokitoto slot gacor logototo slot depo 5k bobatoto bobatoto bobatoto slot gacor sontogel PASCOL4D LOGIN mpo slot sumbartoto mataramtoto slot gacor situs toto slot situs slot situs toto pakde4d link slot sumbartoto Login bandar toto popotogel login slot gacor nobu99 situs toto logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo Slot Malaysia bobatoto istanaslot sumbartoto mataramtoto meteorbet88 login 33ag rp888 AMANAHTOTO www.pajaktoto.io kari4d kari4d kari4d kari4d pascol4d pascol4d pascol4d situs toto toto slot situs slot slot ilmutoto toto toto slot SLOT GACOR slot gacor slot bento11 link slot gacor AMANAHTOTO KARI4D PUCUK4D pascol4d situs slot situs slot toto slot titi4d ilmutoto situs toto