HTTP2 如何解决 Head of Line 阻塞 (HOL) 问题 [英] How does HTTP2 solve Head of Line blocking (HOL) issue

查看:18
本文介绍了HTTP2 如何解决 Head of Line 阻塞 (HOL) 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTTP2 如何解决线头阻塞 (HOL) 问题?

How does HTTP2 solve Head of Line blocking (HOL) issue?

这个问题在http1.1中很常见,不过听说HTTP2已经解决了这个问题.有人能解释一下 HTTP2 究竟是如何解决这个问题的吗?

This problem is very frequent in http1.1, but I heard HTTP2 has fixed this problem. Could someone explain how exactly HTTP2 fixed the problem?

推荐答案

HTTP Head of line 阻塞

HTTP 术语中的行头阻塞通常是指这样一个事实,即每个浏览器/客户端与服务器的连接数量有限,并且通过这些连接中的一个执行新请求必须等待这些连接完成后才能执行可以开火.

HTTP Head of line blocking

Head of Line blocking in HTTP terms is often referring to the fact that each browser/client has a limited number of connections to a server and doing a new request over one of those connections has to wait for the ones to complete before it can fire it off.

行首请求阻塞后续请求.

The head of line requests block the subsequent ones.

HTTP/2 通过引入多路复用解决了这个问题,这样您就可以通过同一连接发出新请求,而无需等待之前的请求完成.

HTTP/2 solves this by introducing multiplexing so that you can issue new requests over the same connection without having to wait for the previous ones to complete.

理论上,HTTP/1.1 的流水线也提供了一种绕过 HOL 的方法,但在实践中实现起来很棘手且很容易出错.这使得它直到今天都没有在网络上广泛启用.

In theory, the pipelining of HTTP/1.1 also offered a way around HOL, but it was tricky and very error-prone to implement in practice. That has made it not get widely enabled on the web even up till today.

然而,HTTP/2 仍然受到另一种 HOL 的影响,即在 TCP 级别.TCP 流中丢失的一个数据包使所有 流等待,直到该数据包被重新传输和接收.正在使用 QUIC 协议解决此 HOL...

HTTP/2 does however still suffer from another kind of HOL, namely on the TCP level. One lost packet in the TCP stream makes all streams wait until that packet is re-transmitted and received. This HOL is being addressed with the QUIC protocol...

QUIC 是一个类似 TCP"的程序.在 UDP 上实现的协议,其中每个流都是独立的,因此丢失的数据包只会停止丢失的数据包所属的特定流,而其他流可以继续.

QUIC is a "TCP-like" protocol implemented over UDP where each stream is independent so that a lost packet only halts the particular stream to which the lost packet belongs, while the other streams can go on.

HTTP/3 是通过 QUIC 而不是 TCP 和 TLS 完成的.

HTTP/3 is being done over QUIC instead of TCP and TLS.

这篇关于HTTP2 如何解决 Head of Line 阻塞 (HOL) 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆