News for hackers. Stuff that matters.
Re:HTTP/3: Everything you need to know about the next-genera... by tashoecraft on Saturday February 12, 2022 @07:38PM (#30317877)
I just recently got my company to switch over to http2 and halved our load time across the board. It might go down as the greatest improvement in customer experience for the simplest action I’ll ever do.
Re:HTTP/3: Everything you need to know about the next-genera... by pottertheotter on Saturday February 12, 2022 @10:14PM (#30318786)
What caused this? I don’t know much about http
Re:HTTP/3: Everything you need to know about the next-genera... by cogman10 on Saturday February 12, 2022 @10:29PM (#30318883)
http2's biggest advantage is it's multiplexed over a single tcp connection. So if your site has a bunch of resources on it, then http2 will allow your clients to request all their required resources at once without establishing a bunch of TCP connections.

Browsers allow for somewhere around 6 simultaneous TCP connections (which means around 6 concurrent requests with http1.1). Http2 allows for http requests at the speed of the clients upload connection (effectively unlimited).

Re:HTTP/3: Everything you need to know about the next-genera... by theelous3 on Sunday February 13, 2022 @07:52AM (#30321399)
I don't get this explanation.

Over one tcp connection, these "unlimited" requests are interleaved, blocking each other for periods of time.

With multiple tcp connections I can have parallelism. It seems like for larger requests, you would suffer performance loss with http2? What am I missing here. Must be something.

Re:HTTP/3: Everything you need to know about the next-genera... by cogman10 on Sunday February 13, 2022 @11:40AM (#30323002)
Well, let's start from the bottom. For most computers and systems, there is only a signal network interface (and if not, there's usually just a single route from A to B.) So, when you say "I can have parallelism" you have to realize that even without a multiplexed TCP connection, the operating system is playing the same game. It is interleaving and blocking bits to the NIC even with multiple TCP connections.

The parallelism you see with multiple TCP connections comes from the fact that the NIC is not (generally) saturated sending and receiving bits.

So with that out of the way, where's the benefits?

One is eliminating the TCP slow start [1]. TCP was designed generally with the notion that you'd only ever have 1 connection between 2 computers. As a result, it has baked into the protocol network congestion sensing protocols. More connections == more congestion control == slower requests. It also, however, means that the first request of every connection will be penalized as the connection warms up. A single connection pays that penalty once.

Another is the latency problem. In order for a connection to be used, you need to send the data from the client to the server and then receive a response from the server. During that time, your connection is bound up (ignore http pipelining, it never worked well). You cannot add more bits down that connection, you have to wait for the server to process and send back response. If that round trip time takes 200ms, that's 200ms of sitting around doing nothing. During that time, over a 100Mbps connection your client could have sent 2.5MB worth of requests to the server. Because http request are typically very small (usually in the bytes), that's a lot of potential requests. This leads to the servers more than likely being able to saturate the connection which is what you want if you are trying to maximize performance.

> It seems like for larger requests, you would suffer performance loss with http2?

A little tricky, it depends on what you are measuring. A large request will block other requests going through while it is streaming. In that scenario, you'd still be saturating the network line but the perceived concurrency would be down. So, from a requests/sec standpoint, that could end up being lower. But from a data-throughput standpoint, you'll be better off still than http1 due to the better network congestion handling of a single TCP connection. (The ole latency v throughput problem).

This is where we enter HTTP3, which bucks TCP as the primary request carrier for UDP messages instead. HTTP3 allows for much lower connection establishment costs (so making multiple QUIC connections isn't as expensive) but also contains protocol changes for errors which keeps an bad packet from blocking all the inbound packets (TCP will freeze the stream while it goes back up the connection to get the correct packet).

[1] https://blog.stackpath.com/tcp-slow-start/

Re:HTTP/3: Everything you need to know about the next-genera... by theelous3 on Wednesday February 16, 2022 @09:47AM (#30360604)
Very reasonable. I had forgotten to consider that this parallelism was smoke and mirrors from the ground up.

This is an excellent comment and very helpful. Thank you.

Re:HTTP/3: Everything you need to know about the next-genera... by jart on Saturday February 12, 2022 @11:25PM (#30319212)
HTTP/1.1 can do this. It's called pipelining. But browsers refuse to implement it.
Re:HTTP/3: Everything you need to know about the next-genera... by bigbonch on Saturday February 12, 2022 @11:35PM (#30319264)
Would still be constrained to head-of-line blocking which HTTP/3 aims to solve.
Re:HTTP/3: Everything you need to know about the next-genera... by baybal2 on Sunday February 13, 2022 @01:50AM (#30319835)
HTTP/3 will not be adopted because it's a downgrade from HTTP/2 for CDN companies.

HTTP/2 has indeed massively benefitted CDNs by providing more effective capacity per buck, but UDP based 3.0/QUIC will singlehandedly destroy it, and bring it to below HTTP 1.1.

Re:HTTP/3: Everything you need to know about the next-genera... by celsoazevedo on Sunday February 13, 2022 @03:56AM (#30320368)
Major CDNs seem to be adopting HTTP/3 just fine:

Cloudflare: https://blog.cloudflare.com/http3-the-past-present-and-futur...

Akamai: https://developer.akamai.com/blog/2020/04/14/quick-introduct...

Fastly: https://www.fastly.com/blog/why-fastly-loves-quic-http3

Not to mention Google, which uses it a lot for regular pages and for content (eg: YouTube video).

Adoption client-side also seems to be moving quickly too. I looked at the stats for 2 of my sites and HTTP/3 is now at 60-70%, with HTTP/2 having dropped to 25-30% already.

Re:HTTP/3: Everything you need to know about the next-genera... by baybal2 on Sunday February 13, 2022 @04:02AM (#30320392)
Good for them, when they have money to spend on servers. Budget CDNs are much less happy.
Re:HTTP/3: Everything you need to know about the next-genera... by celsoazevedo on Sunday February 13, 2022 @04:36AM (#30320524)
That might be the case, but HTTP/3 is supported by most major CDNs and browsers. It has been adopted already.

Also, if this blog post from 2020 is correct, performance per buck isn't that bad with some teaks: https://www.fastly.com/blog/measuring-quic-vs-tcp-computatio...

I assume things have evolved since 2020.

Re:HTTP/3: Everything you need to know about the next-genera... by tehbeard on Sunday February 13, 2022 @02:27AM (#30319967)
Could you give an eli5 as to why that's the case? Or are you just throwing out a proclamation?
Re:HTTP/3: Everything you need to know about the next-genera... by anticensor on Monday February 14, 2022 @01:58AM (#30329049)
The solution to that is QUIC over IP, i.e. removing UDP from the stack.
Re:HTTP/3: Everything you need to know about the next-genera... by tsimionescu on Sunday February 13, 2022 @02:17AM (#30319927)
Browsers implemented it, but had to drop support because proxies don't support this, so in practice it turned out to be a major source of bugs.
Re:HTTP/3: Everything you need to know about the next-genera... by ghusbands on Monday February 21, 2022 @05:06AM (#30413888)
It was also a source of obscure bugs and DoS-level resource usage in servers and (non-browser) clients. Some servers managed to send multiple responses together or deadlocked the connection when the timing of requests or available responses was just right. Some servers would queue up responses in memory and so were prone to excess resource usage.

Also, if you had a sent request waiting behind a slow/large response, you had to decide whether or not to send an extra request on a separate connection to get the resource sooner. And when a server closed a connection after sending a response (the spec allows it for multiple reasons), it was hard to know whether it was that the server was just not accepting more requests on that connection or whether a particular request caused it and hence whether any of the waiting request(s) should be re-sent or treated as being in error.

Re:HTTP/3: Everything you need to know about the next-genera... by 1vuio0pswjnm7 on Sunday February 13, 2022 @02:30AM (#30319974)
It isn't multiplexed. You get the responses back in the same order that you request them. I actually prefer this because I use pipelining outside the browser. I do not want to have to re-ordering responses. I have never found the lack of multiplexing to make HTTP/1.1 pipelining any less useful.^1 It is still fast. HTTP/2 and HTTP/3 appear to be designed for a web of advertising, not a web where someone is using non-browser programs to efficiently request multiple files via HTTP from a single IP address.

Some browsers implemented it, at least temporarily. However the important point no one mentions is that servers implemented it, permanently. I have been using HTTP/1.1 pipelining continuously since the mid 2000's. I could not even name an httpd that does not implement support for HTTP/1.1 pipellining (no doubt some HN commenter will come up with one, but it is a rare exception to the general rule).

1. I do not need compressed HTTP headers either. I like ASCII headers as they are useful record separators for catenated HTML. I have the forward proxy configured to add useful headers that provide additional information about the connection.