Earlier this week I talked about how I upgraded my podcast site to ASP.NET Core 2.2 and added Health Check features fairly easily. There's a ton of new features and so far it's been great running on my site with no issues. Upgrading from 2.1 is straightforward.
本周初,我谈到了如何将播客站点升级到ASP.NET Core 2.2并相当容易地添加了运行状况检查功能。 有大量的新功能,到目前为止,在我的网站上运行非常顺畅,没有任何问题。 从2.1升级很简单。
Introduction of Endpoint Routing with up to 20% improved routing performance in MVC
Improved URL generation with the LinkGenerator class & support for route Parameter Transformers (and a post from Scott Hanselman)
使用LinkGenerator类改进了URL生成,并支持路由参数转换器(以及Scott Hanselman的帖子)
Up to 400% improved throughput on IIS due to in-process hosting support
Problem Details (RFC 7807) support in MVC for detailed API error results
Up to 60% improved HTTP Client performance on Linux and 20% on Windows
I wanted to look at just a few of these that I found particularly interesting.
我只想看看其中一些特别有趣的东西。
You can get a very significant performance boost by moving ASP.NET Core in process with IIS.
通过将IIS与ASP.NET Core一起进行处理,可以大大提高性能。
Using in-process hosting, an ASP.NET Core app runs in the same process as its IIS worker process. This removes the performance penalty of proxying requests over the loopback adapter when using the out-of-process hosting model.
使用进程内托管,ASP.NET Core应用程序与其IIS工作进程在同一进程中运行。 当使用进程外托管模型时,这消除了通过环回适配器代理请求的性能损失。
After the IIS HTTP Server processes the request, the request is pushed into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an
HttpContext
instance to the app's logic. The app's response is passed back to IIS, which pushes it back out to the client that initiated the request.IIS HTTP Server处理请求后,该请求将被推送到ASP.NET Core中间件管道中。 中间件管道处理该请求,并将其作为
HttpContext
实例传递给应用程序的逻辑。 该应用程序的响应被传递回IIS,IIS将其推回到发起请求的客户端。
HTTP Client performance improvements are quite significant as well.
HTTP客户端性能的改进也非常重要。
Some significant performance improvements have been made to SocketsHttpHandler by improving the connection pool locking contention. For applications making many outgoing HTTP requests, such as some Microservices architectures, throughput should be significantly improved. Our internal benchmarks show that under load HttpClient throughput has improved by 60% on Linux and 20% on Windows. At the same time the 90th percentile latency was cut down by two on Linux. See Github #32568 for the actual code change that made this improvement.
通过改进连接池锁定争用,对SocketsHttpHandler进行了一些重大的性能改进。 对于发出许多传出HTTP请求的应用程序(例如某些微服务体系结构),吞吐量应显着提高。 我们的内部基准表明,在负载下,HttpClient吞吐量在Linux上提高了60%,在Windows上提高了20%。 同时,在Linux上将90%的延迟减少了两倍。 有关改进的实际代码更改,请参见Github#32568 。
HTTP/2 is enabled by default. HTTP/2 may be sneaking up on you as for the most part "it just works." In ASP.NET Core's Kestral web server HTTP/2 is enabled by default over HTTPS. You can see here at both the command line and in Chrome I'm using HTTP/2 locally.
默认情况下启用HTTP / 2。 在大多数情况下,“ HTTP / 2”可能会在您身上悄悄溜走。 在ASP.NET Core的Kestral Web服务器中,默认情况下通过HTTPS启用HTTP / 2。 您可以在命令行和Chrome浏览器中看到这里,我在本地使用HTTP / 2。
![HTTP/2 locally HTTP/2 locally](https://i-blog.csdnimg.cn/blog_migrate/e9732732e73059e9653dfde81beefb8e.png)
Here's Chrome. Note the "h2."
这是Chrome。 注意“ h2”。
![HTTP/2 in Chrome HTTP/2 in Chrome](https://i-blog.csdnimg.cn/blog_migrate/e107dcf757387b01fbae2bd9b6f58ea1.png)
Note that you'll only be able to get HTTP/2 when ALPN (Application-Layer Protocol Negotiation) is available. That means ALPN is supported on:
请注意,只有当ALPN(应用层协议协商)可用时,您才能获取HTTP / 2。 这意味着ALPN在以下方面受支持:
.NET Core on Windows 8.1/Windows Server 2012 R2 or higher
Windows 8.1 / Windows Server 2012 R2或更高版本上的.NET Core
- .NET Core on Linux with OpenSSL 1.0.2 or higher (e.g., Ubuntu 16.04) 具有OpenSSL 1.0.2或更高版本Linux上的.NET Core(例如,Ubuntu 16.04)
All in all, it's a solid release. Go check out the announcement post on ASP.NET Core 2.2 for even more detail!
总而言之,这是一个可靠的版本。 请查看有关ASP.NET Core 2.2的公告,以了解更多详细信息!
Sponsor: Preview the latest JetBrains Rider with its Assembly Explorer, Git Submodules, SQL language injections, integrated performance profiler and more advanced Unity support.
赞助商:预览最新的JetBrains Rider,包括其Assembly Explorer,Git子模块,SQL语言注入,集成的性能分析器以及更高级的Unity支持。
翻译自: https://www.hanselman.com/blog/useful-aspnet-core-22-features