头图

Hello everyone, I'm Li Shuai from the Microsoft MVP Lab Research Institute in this issue. In the recent June 6th, HTTP/3 has officially released RFC, and whether HTTP/3 using QUIC's new protocol can make the website faster, let's take a look at its performance through the following test .

Researcher at Microsoft MVP Labs


image.png

A Brief History of HTTP

The first official version of HTTP (Hypertext Transfer Protocol 1.0) was completed in 1996. But some problems were found, and according to the authors, HTTP/1.0 did not adequately account for layered proxies, caching, the need for persistent connections, and the impact of virtual hosts. So HTTP/1.1 was released a year later, in 1997, and it was also the most widely used version.
In HTTP/1.1, the browser can only download one file at a time through a TCP connection, if a page needs 10 js files, then these files will be downloaded sequentially. The delay of a file will block other content behind, which is what we often call head of line blocking.
After 18 years, the HTTP protocol ushered in an update, HTTP/2 (RFC 7540) was released. A big feature of HTTP/2 is multiplexing. The binary frame and stream mechanism is introduced, allowing the use of a single TCP connection to download resources in parallel through Stream, which improves transmission efficiency.
In addition, there is a header compression HPACK algorithm to reduce the transmission of repeated header data.
image.png
However, although HTTP/2 solves the head-of-line blocking of HTTP, it will still be affected by the head-of-line blocking of TCP.
In fact, in environments with high packet loss, HTTP/1.1 performs better because the browser opens multiple parallel TCP connections!

▌True multiplexing with HTTP/3 and QUIC

The main difference between HTTP/2 and HTTP/3 is the transport protocol they use. HTTP/3 uses the new QUIC protocol to replace the TCP protocol, and QUIC is developed based on UDP. Unlike TCP, UDP does not require a three-way handshake. Combined with TLS1.3, it also brings the possibility of 0-RTT encrypted transmission. HTTP /3 also brings a new header compression algorithm, QPACK.

image.png

Test content

▌Site

A front-end static site contains 10 js files, 19 images, some css and fonts, a total of 36 resources, and a total size of 6.6 M.

image.png

▌Server

Azure Standard B2s, 2 Core 4G, Linux (Ubuntu 20.04), Web
The server uses Caddy (I tried nginx before, but now I need to compile the code of nginx-quic to use HTTP/3. After tossing around, there are still problems, so I gave up), in contrast, Caddy is simple to open HTTP/3, and automatically https certificates are also handy. Also set Cache-Control: "no-store", disable cache,
HTTP/3 has 0-RTT set.

▌Location

The client is located in Shanghai, and the server is located in San Francisco, USA, and the distance between the two places is about 10,000 kilometers.

image.png

▌Three versions
HTTP/1.1: https://sfh1.lixiaoshuai.com/
HTTP/2: https://sfh2.lixiaoshuai.com/
HTTP/3: https://sfh3.lixiaoshuai.com/

Each site was visited 10 times using Chrome, and the time was recorded.

Test Results

Finally, let's take a look at the test results. HTTP/1.1 averages 3500 ms, HTTP/2 averages 2500 ms, and HTTP/3 averages 1300 ms. It can be seen that the performance improvement brought by HTTP/3 is still obvious.
图片

Summarize

On June 6 of this year, the IETF (Internet Engineering Task Force)
Officially released the RFC for HTTP/3. The complete RFC is more than 20,000 words and explains HTTP/3 in great detail.

As you can see, HTTP/3 is fast! Large companies like Google and Facebook are already using HTTP/3 for their services, and web servers are actively embracing the new protocol and providing experimental support. And can QUIC replace the decades-old TCP? Let's wait and see!

Related Links

https://kinsta.com/blog/http3/
https://en.wikipedia.org/wiki/HTTP/2#Criticisms
https://en.wikipedia.org/wiki/HTTP/3

Microsoft Most Valuable Professional (MVP)

image.png

The Microsoft Most Valuable Professional is a global award given to third-party technology professionals by Microsoft Corporation. For 29 years, technology community leaders around the world have received this award for sharing their expertise and experience in technology communities both online and offline. MVPs are a carefully selected team of experts who represent the most skilled and intelligent minds, passionate and helpful experts who are deeply invested in the community. MVP is committed to helping others by speaking, forum Q&A, creating websites, writing blogs, sharing videos, open source projects, organizing conferences, etc., and to maximize the use of Microsoft technical community users
Microsoft technology. For more details, please visit the official website:
https://mvp.microsoft.com/en-us

image.png
Long press to identify the QR code and follow Microsoft developers MSDN

Click to go to the Microsoft developer site~


微软技术栈
423 声望998 粉丝

微软技术生态官方平台。予力众生,成就不凡!微软致力于用技术改变世界,助力企业实现数字化转型。