有用的ASP.NET Core 2.2功能

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升级很简单

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

Here's Chrome. Note the "h2."

这是Chrome。 注意“ h2”。

HTTP/2 in Chrome

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在以下方面受支持:

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值