ASP. NETCore Kestrel server, asp. netcorekestrel

Source: Internet
Author: User

ASP. NETCore Kestrel server, asp. netcorekestrel
What is a Kestrel server?

 

Kestrel is an open-source (Source Code provided by GitHub) event-driven asynchronous I/O server used to host ASP. NET Applications on any platform. This is a listening server and a command line interface. Install the listening server on a Windows or Linux server, and install the command line interface on your computer (the installation of. netcore will automatically complete the installation ).

It was launched by Microsoft along with ASP. NET Core. All ASP. NET Core applications use the new MVC Framework and Kestrel Web server. These new applications can run on the complete. NET Framework or. NET Core.

Kestrel Web Server Overview

Kestrel is considered to be the preferred Web server for newer ASP. NET Applications (refer to this article for comparison with IIS, why you need both ). It has the same libuv library as the library used by node. js. Libuv supports the event-driven programming style. Some of its core tools include:

  • Non-blocking network support
  • Asynchronous File System Access
  • Timer
  • Sub-Process

It allows ASP. NET Core applications to run easily on other cross-platform Web servers (such as Jexus, Nginx, and Apache) without the need to solve different startup configurations. By using Kestrel as the in-process server, even if cross-platform support is available, the application will have consistent processing (Startup (Main (),Startup. ConfigireServices (),Startup. Configure ())

 

How Kestrel Web server works

Applications are usually written to respond to human behaviors. Event-driven programming involves a loop to listen to events. Then a callback function is triggered. To reduce the number of SYS calls, all other work is executed in the managed code of the standard. NET working thread.

Kestrel provides an event loop and callback-based I/O notifications. Libuv manages collection and monitoring of events from the operating system. In addition, you can register a callback when an event occurs. Therefore, Kestrel uses libuv for I/O and supports running multiple event loops.

Because it is lightweight, Kestrel does not allow you to perform SSL termination, URL rewriting or GZip compression, but the same lightweight design makes it faster than other servers. In fact, it is 6 times faster than node. js for static and plain text operations.

Benefits of Kestrel

Kestrel supports all platforms and versions supported by. NET Core. In addition, the new ASP. NET Core project template that is included by default can provide better request processing performance. When you create a project in Visual Studio, the project is automatically configured to run in Kestrel.

As mentioned above, this is not a fully functional network server, but it is precisely why it is fast. If you think you need speed, Kestrel is the answer-especially because it is designed for production in ASP. NETCore.

What you can do is run it after a fully functional network server (such as IIS or NGNIX. You can useHttpPlatformHandlerRun it after IIS or use it after Visual StudioHttpPlatformHandlerRun it after IIS Express. In addition, you need to support it in the ASP. NET Core project, so that developers can easily run them on any supported platform.

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

Because Kestrel is not a full-featured Web server, you should let the web program run after IIS or NGNIX (IIS; Jexus or NGINX proxy web program, which provides the form of work forwarded to Kestrel ). It aims to make ASP. NET as fast as possible, but its ability to manage security and provide static files is limited. If you are using Kestrel as the ASP. NET Core of the web server, you can use Prefix to implement powerful code analysis functions.

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.