Hacker News new | ask | show | jobs
by enneff 4144 days ago
Whatever PHK wants it to be, HTTP/2 is a great step forward from where we are today. Check this out: https://http2.golang.org/gophertiles

This is going to make the web so much faster, particular on mobile devices.

4 comments

> Whatever PHK wants it to be, HTTP/2 is a great step forward from where we are today.

A hugely bloated, binary protocol is better than the simple, text-based on we have today? I greatly disagree. HTTP/1.1 could use an update, but HTTP/2 was not the answer.

I wonder if anyone complaining about binary formats has ever written a high performance parser.

Particularly, HTTP's text format, is a mess. You can continue headers from one line to another. You can embed comments into header values. Seriously. Comments. In a protocol's messages. It's moronic and indefensible. Why anyone would prefer that is probably them thinking that text equals easy to implement or something like that.

I never said HTTP/1.1 is perfect. There are many possible optimizations and fixes possible, of which you've alluded to one.
Only the framing is binary. The PDUs are actually still plain text and 95% (perhaps more) of the semantics of HTTP/1.1 have been retained. Just pointing it out because your comment makes it sound like HTTP/2 is completely binary.

Also, how is HTTP/2 more bloated than HTTP/1.1? It simply adds a little framing; most of the bloat of HTTP/1.1 is retained. And as others have pointed out, HTTP/1.1 is hardly 'simple'.

Somebody on the IETF HTTP WG mailing list (may have been PHK himself) pointed out that their server (Varnish?) spends something like 30% of its CPU time parsing/processing just the Date header because it's in plain text. Plain text is not a panacea. We have nice tools like Wireshark these days which make it much easier for humans to read both binary and plain text protocols.

> Just pointing it out because your comment makes it sound like HTTP/2 is completely binary

Functionally what's the difference? If I'm unable to read the entire message without a decoder, does it matter if I can read part of it?

> It simply adds a little framing;

I think yo forgot the whole reïnventing Layer-4 in Layer-7 thing. That is a travesty -- adding tons of complexity to solve a problem that it shouldn't be solving.

> We have nice tools like Wireshark these days which make it much easier for humans to read both binary and plain text protocols.

And the more tools _required_ to debug a problem, the harder it becomes to debug.

> spends something like 30% of its CPU time parsing/processing just the Date header because it's in plain text.

Plain-text is not a panacea, however I believe it preferable to a binary protocol for ease of debugging and hackability. If there are issues like the HTTP Date is causing trouble for many people, maybe we should look into how that could be made easier? A better format? Does the Date header even need to exist? (I actually don't think it does, along with Server, UA, and a couple others).

Additionally, I really wish that HTTP/2 would have actually attempted to solve problems faced by smaller HTTP users, and not force a behemoth of complexity (remember Layer 4 in Layer 7) on users who do not want that. I outline what I was hoping to be solved at https://github.com/jimktrains/http_ng.

HTTP/1.1 is also pretty bloated, it's just half the features nobody bothered to implement correctly (pipelining, for instance). HTTP/2 is much the same.
>This is going to make the web so much faster, particular on mobile devices.

The performance benefits are overblown: https://news.ycombinator.com/item?id=8890839

HTTP pipelining doesn't work in practice, so comparing it to SPDY or HTTP/2 is a waste of time.
Every Android phone was using pipelining until Google removed it. Every iOS device uses pipelining since iOS 5.

These phones work in practice.

That's one powerful yet easy-to-understand example!
> Check this out: https://http2.golang.org/gophertiles

This page confirms that I'm not using Google's trainwreck protocol and tells me the config-parameters I need to ensure I keep my browser this way.

    Unfortunately, you're not using HTTP/2 right now. To do so:
    Use Firefox Nightly or go to about:config and enable "network.http.spdy.enabled.http2draft"
    Use Google Chrome Canary and/or go to chrome://flags/#enable-spdy4 to Enable SPDY/4 (Chrome's name for HTTP/2)
This is quite good, although probably not for the reason the original authors intended.