知识卡片

普通读书笔记卡 · 3222.b

HTTP2多路复用共享连接

理解等级:中级

HTTP/2 把并发请求映射到同一连接内的多个流,减少为并发请求另开连接的需要。它的帧层与头部压缩是不同机制,不能说所有消息体都会自动被压缩;HTTP/1.1 也可复用连接,因此比较收益要看并发模式、连接管理与真实负载。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      The advantage of binary framing is that it allows for a full request and response multiplexing over a single connection. Consider processing a list in another service and the requirement is to retrieve 20 different attendees; if we retrieved these as individual HTTP/1 requests it would require the overhead of creating 20 new TCP connections. Multiplexing allows us to perform 20 individual requests over a single HTTP/2 connection.

    参考来源

    - 位置:《Mastering API Architecture》第1章《Design, Build, and Specify APIs》之《HTTP/2 Performance Benefits》(源文件:_epub-src/OEBPS/ch01.xhtml) - 结论依据:原文用一条连接承载多个请求解释多路复用;“HTTP/1 每个请求都要新建 TCP 连接”和“二进制帧压缩消息体”的泛化按 RFC 9113 修正。 - 原始内容:The advantage of binary framing is that it allows for a full request and response multiplexing over a single connection. Consider processing a list in another service and the requirement is to retrieve 20 different attendees; if we retrieved these as individual HTTP/1 requests it would require the overhead of creating 20 new TCP connections. Multiplexing allows us to perform 20 individual requests over a single HTTP/2 connection.