In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces you how to achieve a Kestrel server in ASP.NETCore, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Overview of Kestrel Web server
Kestrel is considered the preferred Web server for newer ASP.NET applications (see this article comparing with IIS, why you need both). It's opportunity libuv library, which is the same library that node.js uses. Libuv supports an event-driven programming style. Some of its core tools include:
Non-blocking network support
Asynchronous file system access
timer
Child process
It allows ASP.NET Core applications to run easily on other cross-platform Web servers, such as Jexus,Nginx and Apache, without having to deal with different startup configurations. By using Kestrel as the in-process server, the application will have consistent processing (Startup (Main (), Startup.ConfigireServices (), Startup.Configure ()) even if there is cross-platform support.
How the Kestrel Web server works
Applications are usually written in response to human behavior. With event-driven programming, there is a loop to listen for events. A callback function is then triggered. To reduce the number of SYS calls, all other work is performed in the managed code of the standard .NET worker thread.
Kestrel provides an event loop and callback-based I / O notification. Libuv management collects and monitors events from the operating system. In addition, users can register callbacks when an event occurs. Therefore, Kestrel uses libuv for I / O work and supports running multiple event loops.
Because of its lightweight, Kestrel does not allow you to do SSL termination,URL rewriting or GZip compression, but the same lightweight design makes it faster than other servers. In fact, it is six times faster than node.js for static and plain text operations.
Benefits of Kestrel
Kestrel supports all platforms and versions supported by the .NET Core. In addition, it includes new ASP.NET Core project templates by default to provide better request processing performance. When you create a new project in Visual Studio, the project is automatically configured to run in Kestrel.
As mentioned earlier, this is not a full-featured web server, but that's why it's fast. If you feel you need speed, Kestrel is the answer-especially because it is designed for ASP.NETCore production.
What you can do is run it after a more fully functional web server (such as IIS or NGNIX). You can use HttpPlatformHandler to run it after IIS, or HttpPlatformHandler after Visual Studio to run it after IIS Express. Also, you need to support it in your 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.
Since Kestrel is not a full-featured Web server, you should have web programs run after IIS or NGNIX (IIS;Jexus or NGINX proxy web programs that provide forwarding to Kestrel). It is designed 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 achieve powerful code analysis capabilities.
On how to achieve a Kestrel server in ASP.NETCore to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.