new essay: why upload with http2 slower than http1.1
This commit is contained in:
parent
bb18cd72c3
commit
d7a38e83ca
19
content/essays/why-upload-with-http2-slower-than-http1.1.md
Normal file
19
content/essays/why-upload-with-http2-slower-than-http1.1.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
title: "HTTP/2 的上传速度表现劣于 HTTP/1.1 的原因"
|
||||||
|
date: 2022-05-30T09:29:51+08:00
|
||||||
|
tags: []
|
||||||
|
categories: []
|
||||||
|
weight: 50
|
||||||
|
show_comments: true
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
在使用 Nginx 提供的 HTTP/2 实现时,有些情况下会发现上传速度不理想,甚至慢于 HTTP/1.1,这是因为 HTTP/2 相较于 HTTP/1.1 多了一个在应用层的流传输控制。
|
||||||
|
|
||||||
|
HTTP/2 和 HTTP/1.1 共同基于的 TCP 也拥有流控制,TCP 的流控制的窗口大小由操作系统决定,并且影响操作系统建立的所有 TCP 连接的速率上限,此上限亦即 HTTP/1.1 的速率上限;HTTP/2 的流控制的窗口大小由对应软件如 Nginx 实现,当此窗口小于 TCP 的窗口并且具有一定的差距时,HTTP/2 的速率会受到明显影响,另一方面当 HTTP/2 的流控制窗口过大时,又会造成内存的浪费,当设定为某一个合适的值时,性能表现甚至会略微胜过 HTTP/1.1。
|
||||||
|
|
||||||
|
## 参考
|
||||||
|
|
||||||
|
[Delivering HTTP/2 upload speed improvements](https://blog.cloudflare.com/delivering-http-2-upload-speed-improvements/)
|
Loading…
Reference in a new issue