The Long Road to HTTP/3
scorpil.com
scorpil.com
But plenty of people have high latency internet connections.
Either due to technology (Mobile network, satellite) or due to them being very far from internet exchanges and the server's they want to connect to.
Here is an example of the speed advantage on a low latency connection:
Of course with my 1gbps broadband in a capital city both are pretty much instant when doing the test: https://imagekit.io/demo/http2-vs-http1
But that's not the majority, it's not most cases. Especially if you leave a city and are on mobile internet with poor signal.
In reality, Google mostly failed to show scientific proof that HTTP/2.0 provides beneficial on typical connections - one major reasoning why even introducing QUIC in HTTP/3. A lot of "amateur benchmarks" float the net claiming HTTP/2 speed superiority, but often the measurements are flawed (not taking TCP peculiarity like congestion control into account or even including it in the analysis; classic fault is failure to disable TCP initcwnd caching or flushing the cache when doing benchmarks).
These are the two sides of complexity: It can create marvelous web applications and it can create no visible advantage.
I we're discussing whether is reasonable - 9/10 slow pages I have encountered are slow because of "content" they push on you and would add even more garbage if they could get away with it. Of the rest - most were the opposite of engineered. Tiny minority that can't be bothered to optimize - I don't mind.
You mention sites with sprites, but I would really like to see an example of a sites that are slow on HTTP<2 for good reasons, i.e. not 90% of data being ads, trackers, popups, auto-playing videos and generating content via multi-MB javascript libraries, because that's how it's done these days.
Yes, there are hacks to work around it (bundling and spritesheets), but they have other tradeoffs, like losing ~all of your cache granularity.
A great example of this happens when someone wants to query for a list of resources.
The rest way for this would be to do requests like this
get /foo/1
get /foo/2
get /foo/3
However, unless you spin up a bunch of parallel connections (wasting a bunch of resources both in the servers and the client), you are going to experience performance issues.The compromise is to create endpoints that look like this
post /foo [1,2,3]
That saves the connection problem but creates a bunch of new issues. The client can send arbitrary request sizes to single servers (making LBing more difficult). It's not idiomatic, which means things like Http caching simply can't be used (or at least are less effective). A lot of http clients will do auto-retry but only for idempotent verbs, that's gone, you now need to implement all that stuff yourself.http2 fixes all that. Making parallel requests for n datapoints isn't nearly as big an issue. Those requests can be fanned out to a bunch of servers and those servers can be in charge of figuring how how much batching thing should be doing before reaching out to the DB. Making it impossible for a single client to really tank the system.
Certainly you can work around this, usually by having the service farm out work over a message bus so you don't run into the problem of a single server going down due to a big request. However, the reason those message buses work and are fast is precisely because they are similar to Http2.
All of these have major consequences for backend services. If I have a fleet of apps talking to another fleet of apps, then it matters, a LOT, if each of those apps are creating 20 TCP connections to the other fleet. Get the wrong kind of load storm and your backend will topple over.
Now, is this super scientific? No. Rather it's based on what I've seen in the field.
Http2 has a ton of benefits when doing a lot of small message communication.
First there was all this hype how awesome HTTP2 would be, no mention of head of line blocking. Then, several years later, lo and behold HTTP3 is hyped next, and one big motivation is that HTTP2 turned out to have a head of line blocking problem.
What on earth is going on here? Google obviously has great engineering talent and HTTP2 must have been high profile enough to not leave to a bunch of interns. So there must be more nuance to this, does anyone know the score?
The alternative to TCP head-of-line blocking is either using a separate connection per request (which was the original performance bottleneck) or using UDP (which would've been a rather big change coming from HTTP/1.1).
Now these problems are solved incrementally, and HTTP/2 plays a part in that. Which part is stupid?
My experience so far is that in practice this rarely works out, you end up with nastier TCP level issues instead and I get the impression that this has been the actual experience with HTTP/2 as well.
In that case the stupid part would be assuming that multiplexing over TCP is a good idea, despite various cautionary tales to the contrary.
As I said, I haven't looked into this carefully so my superficial impressions might well be wrong, which is why I'd appreciate input from someone who has properly looked into it.
And of course SCTP (nor DCCP) are usable on the general Internet.
Of course there is zero chance of this happening (for one thing, it would probably greatly increase the chances of getting broken up earlier rather than later), but it's kind of nice to imagine someone of sufficient size throwing their weight around to stop socializing costs and shake up the useable protocol stack a bit again, and retire a lot of horrible hacks and complexity in one fell swoop.
The problem with HTTP 2.0 is it does not really improve the performance in real life as in Google's "real life benchmarks," it especially does not improve the situation on lossy, and throttled connections, and may actually lead to a degradation over HTTP 1.1.
The "real life benchmarks" data from Google about QUIC is put under doubt in this light.
I hear this argument a lot, and fail to be convinced. Optimizations at scale matter a lot. Let's posit that 100,000 developer-years have been spent implementing HTTP/2 and tools to interact with it. (Hopefully a great over-estimate). Let's say we have to spend all that again to move to HTTP/3. Is it worth it?
Well, per random internet stats I haven't validated, there are about 4b internet users, spending about 3h per day on the internet apiece. I could imagine 5% of that is spent on synchronous resource loading. That's about 10m/day/user - or about 28M years/year spent waiting on resources to load. A 1% savings (the minimum of CloudFlare's range) is 280k human years / year. And that's the bottom end - could be as high as 4% (1.1M years/ year), and without BBR (negatively impacting high packet loss and high throughput connections in particular).
Is "persons average time on the internet" comparable to "paid developer time"? No. A lot of that user time is timeboxed "wasted" time, in the endless content scroll. With that in mind, is it worth it overall? Probably. I've tried to estimate in favor of developers, but I still get their one-time effort paid back 2.8-11x _each year_ in user time, under unfavorable conditions. And this is growing rapidly, both in user count and time per user.
And that says nothing about the privacy benefits of encrypting headers and whatnot, which you should probably ascribe nonzero value.
The massive switching cost of IPv6 has slowed deployment for a decade. Since it's so expensive to switch to HTTP/3, it only benefits large companies like Google. To smaller companies it's a cost.
Only 33% of the web is using HTTP/2, which came out 6 years ago. Any big gains we're talking about are many years in the future when internet speed will be maybe double what it is now. The slow adoption of HTTP/2 relative to its great benefits compared to HTTP/3 shows you how bad adoption will be.
Since 3 is single digits percent better than two, I bet adoption won't cross 20% for almost ten years. It's only going to be the FAANG'S of the world that think such as small increase in performance is worth the switching cost.
So that was kinda a rant but I don't think throwing out big numbers because so many people use the web is a strong argument. Users aren't the ones paying a large cost for a small performance increase
Speed increases will presumably be consumed by continued bloat on part of publishers, as has historically happened in all tech innovations. Which might argue that it doesn't matter regardless and no optimization is ever useful, but that's both defeatist and ignores companies who do care (e.g. CloudFlare), for whom 4% probably matters now and will matter still in a decade.
Everything that touches HTTP connections. Proxies, transparent proxies, web application firewalls, every network analysis and debugging tool, layer 7 load balancers.
There's probably half a million hardware firewalls out there that won't ever get a software update. As soon as http/3 is released, they're useless. The ones that can be upgraded need downtime and people time to do so. Just in firewalls this change could cost 400 million.
Realistically, the consequences of HTTP/3 will cost billions. Is 4% faster speed worth that? There's a lot of other ways to increase speed 4% without spending any money. Like turning on profile guided optimization in the browser, or just waiting a year for CPU and network speeds to increase that much.
I'm not being defeatist here, a maximum of 4% performance increase is just not very good. Nobody would switch a video or audio codec for a few percent, why is HTTP considered easier?
I say to Google: come back with something better. 20-30%? Totally worth it. If HTTP/2 is truly within 4% of optimal we should never touch it again
The error correction below layer 7 is a problem, because error in one stream blocks all streams, and lower levels of the stack can't help that.
Cellular is less severe but similar. Fixing head of line blocking at layer 7 won't un-interleave the packets.
This is awful, because it means the spec review process does not have the impact that it can have, and Chrome gets to single-handedly define what they want the spec to be
Tiered how? By IP? With most content served by a CDN or DDOS shield already, that's arguably fine; most meaningful on the customer IP where you'd want fairness across customers anyways. Or do you mean internet providers will privilege their own content? Already happening, to the extent allowed by law (I'm looking at you, FCC). Not likely to change with HTTP/3 - empirically, needs to be addressed by regulation and not technology.
Complicated protocol, unfriendly to hackers, offering huge corporation some millisecond savings to enforce their walled garden supremacy.
Example: I run a service without a CDN, but I only host it on dedicated servers located in Europe. Per-request latency is OKish for users in the US, but my service makes dozens of subrequests to the same origin when loading pages (images, XHR calls). Without HTTP/2, the user-experience for US customers would be abysmal and I'd be forced to reach for a CDN which has a PoP closer to them.
HTTP/2
Besides the performance improvements brought in HTTP/2 via compression of headers and ability to multiplex streams it also enables full-duplex communication (à la WebSockets) [1]. This is used for example in gRPC, making the protocol far more versatile than given credit.
[1] No, I'm not talking about Server Push.
HTTP/3
HTTP/3 should bring benefits in wireless connections where TCP disconnections are frequent. QUIC handles connection identification so frequent TCP disconnects or even changing IPs would impact much less an HTTP/3 connection. I don't have the benchmarks but I would expect HTTP/3 to shine in this scenario which is bound to be more and more relevant with mobile devices, 5G, etc... In ideal, wired network, conditions HTTP/3 is probably not going to bring any improvement maybe even worse performance considering how much effort must have gone to optimizing TCP.
For me, both upgrades have a raison d'être but that doesn't mean that they displace HTTP/1.1 of all use cases. If you don't care about the performance improvements or need full-duplex no need to use HTTP/2, if you are not targeting mobile networks no need for HTTP/3. Luckily protocol negotiation should be quite seamless.
On top of that, HTTP/2 itself can do full-duplex communication so it can be used as a replacement of WebSocket, no negotiation or protocol upgrade involved. This capability is rarely used though but is, for example, leveraged by gRPC which is able to do bidirectional streaming [1].
millisecond savings for all their users, which adds up to saving man-years every day. It is literally preventing people wasting lifetimes of effort looking at loading spinners.
If you can do better, propose it, but don't force other people to waste lifetimes of effort otherwise.
It had major benefits like pure text protocol, that one could use even by doing telnet to webserver (I did that when I needed to debug some pesky issues), starting with HTTP 2.0 it all goes to binary protocol (there is a text one, but almost no browser supports it :( ).
And now, on top of that replace years of performance tuning TCP out of the window and use UDP, and invent TCP features on top of UDP.
Yes, it is faster (few percent, this is not a 50% increase, it is a mere 3%), but the benefits will be reaped by the largest of corporations.
Is it worth it? Maybe for end users (who will get their web page in 485 ms instead of 500ms), but for developers it is not.
I was expecting HTTP 3.0 to get us huge benefits, but the numbers that were posted few days ago in hacker news are so underwhelming that I just don't care for it at all.
And cost of development is high.
But to consider those rare instances to be equal or exceeding the value of a significant across-the-board performance increase is ridiculous. As are your attempts at populism: even against specific arguments how the benefits are more meaningful for smaller websites, you repeat the assertion that “the benefits will be reaped by the largest of corporations”. At least you have the decency to immediately contradict yourself.
Extraordinary claims require extraordinary proof.
Thanks
When HTTP 1.1 fails, your browser shows you a proper error message. When HTTP 2/3 fails, it is always "a protocol format violation". What violation? Why? Who knows.
> I don't agree that this particular concern is large enough to slow adoption
Sure thing. Kerberos is still alive and kicking. SMB 1 is built into every appliance. SOAP is the protocol of choice for corporations...
Complexity never slows down adoption of <insert name of utter turd technology>, because such technology is generally being pushed down people's throats by someone else. If Google does not push HTTP 3 slower, it's adoption won't slow down. The quality of tech plays no role in that.
A protocol format violation notice could tell you what was wrong it just hasn't been developed to the full extent to do so. Give browsers and tools time to develop and be built to properly debug the connection.
If the users see the benefit then the companies that the developers work for will find a new competitive advantage, which benefits the developers (higher profit, better job security, etc).
It's impossible for one group to benefit without the other group also benefitting.
What isn't?
But you're also ignoring the fact that these benefits will also be reaped by end-users - and more by people who have poor connections to the Internet.
>Is it worth it? Maybe for end users (who will get their web page in 485 ms instead of 500ms), but for developers it is not.
The Internet is for End Users,[0] not for developers. UX >>> DX.
And I wrote that big corporations, because those have millions of users, if users download faster then they can server even more users on smaller amount of hardware. 3% less hardware, that might be big if you are big.
And considering it is developed by Google and pushed into Chrome they will get that benefit sooner than others.
I think we’d see faster websites more often if developers had worse computers, or they invested more time in testing in resource constrained environments. I really don’t think react (or similar) is the core problem.
There's already a "browser platform framework", it's standard, built into your browser and very fast.
Trying to re-implement the browser inside the browser using Javascript is a recipe for disaster. (Indeed: witness the "modern" web.)
I get that something more enterprisey-feeling with more knobs for programming in the large is more agreeable to the assembly-line programmer in large IT shops, but if you want your browser apps to act nice you'll have to suck it up and program natively without the overhead of a framework.
I think this is quite an important point. If the protocol is so complex such that creating custom implementations is prohibitive then that's an issue, and also perhaps a 'smell'
I had enough weekends wrecked by someone thinking they can implement HTTP themselves, only to find out that no, they couldn't, and that was for cases that didn't even hit corners. A netcat "HTTP server" demo is cute, but the power of the computer is that we make tools to make tools that can cover things like HTTP/2 reasonably fast - and much more correct.
If I find someone's "quick and dirty HTTP client library", I generally lose hope that redirects are handled. Anything more complex than that (and there's a lot!) is pipe dream.
Simple doesn't always mean better.
The text nature makes it easy to implement a broken client or server in a hobbled development environment, yes. It also creates a legacy of brammage that is impossible to fix without significant break in protocol like HTTP/2 is.
Shortly speaking, Postel's Law Considered Harmful (in network protocols, at least)
OSI stack is better, but usually you'd build on top of higher-level components of it, not "supposedly text but honestly binary" protocol like HTTP.
Being YOLO resulted in it taking over 15 years for email to not have random crashes involving my native language (and it's pretty simple, as it has no multibyte requirements).
YOLO is how the internet has been broken through multi-level NAT, because ca 1980 someone convinced other that for "temporary test deployment" only 32bits will manage.
YOLO is why transition to IPv6 takes ages even when higher level protocol wouldn't even notice, because ~1983 in panic someone made an emergency, student-made port of TOPS-20 TCP/IPv4 interface and we're left picking the pieces forever.
And yes, HTTP and other "text" protocols are essentially binary protocols, because you end up dealing with whatever binary constant form someone put into client/server code. If someone goes too far into treating it as text when sending, suddenly you have a problem of dealing with missing record terminators. Standard header names could be just as well binary, except there's extra variation both possible (if you want to follow Postel's law), and spec (details of encoding).
Isn't also HTTP/3 a significant break in protocol compared do HTTP/2 ?
I've always appreciated that most IETF protocols are text-oriented with line-buffered commands, and the option to speak the protocol directly in this fashion contributed enormously to my own understanding of SMTP, POP3, IMAP, IRC, NNTP, HTTP, FTP et al, and I always regretted not being to do the same with LDAP, SNMP, or BGP.
I recommend that internal network services use HTTPS, there's plenty of reason not to lower your standards internally.