221 points · by vladaionescu · 11y ago · 77 comments
In practice, if you already have an SSL server, just add the "spdy" to the listen line like "listen 443 ssl spdy;", restart and you are done[1].
Then making it proxy request is just one location definition with "proxy_pass"[2].
[1]: http://nginx.org/en/docs/http/ngx_http_spdy_module.html
chadaustin already mentioned nginx, which seems to be the most popular choice.
This is alos one of the examples for H2O:
… and Apache Traffic Server just shipped support in v5.3.0, which might be of interest if you want to setup a generic front-end layer for a ton of backend services:
https://cwiki.apache.org/confluence/display/TS/What%27s+New+...
One thing I haven't looked into is whether any of these will try to use server push for content which has is referenced by <link rel=preload> in an HTML page. That could be very useful for render-blocking CSS/JS.
If the answers are in the slides, forgive me - using the iPad the Google slide software breaks the back button and is too annoying to read beyond a few slide pages. Debugging and implementing older protocols seem to be easier, as they were text based.
Many do, yes.
> Will there be v2-only servers in near future?
Yes.
> Debugging and implementing older protocols seem to be easier, as they were text based.
Implementing text protocols seems to be easier, but writing an implementation that can handle the wide variety of both compliant and slightly non-compliant traffic is an exercise in frustration.
This is not helped by the fact that people see the text protocol and think that it's easy to implement, so they go and write their own HTTP/1.1 server and leave it on the internet. Their server is probably not quite spec-compliant, so everyone else is left trying to interop with it.
Binary protocols are hard to debug by eye, but they aren't hard to write parsers for.
Implementing a text based protocol (SMTP, POP3, HTTP0.x/1.x) for a client application is certainly easier and less documentation is required. Knowing the clusterfk of the binary Office document formats, the newer text based ones re far easier to parse (be it XML or plain text doesn't matter). Be it binary or text based, one has to write a parser anyway. Only with text based protocol one could also use Regex or string match during, which is quite useful for non-production development/testing.
I read about "prioritisation" of data as a hint for the server, and less caching of data on the client. With the reoccurring "net neutrality" debates, let's hope this protocol cannot be misused/used to prioritise certain packets for parties who pay extra. I am not into this debates, but it would be certainly a disadvantage for startups over established parties. Given the many problems with SSL (heartbeat, broken/outdated certs, hijacked cert vendors) an HTTP/2 without SSL would be a nice fallback scenario - wildcard certs for new startups are still a bit expensive, especially if one will have to replace (=costs) the certs every few months due security concerns.
When you're parsing text, all kinds of crazy stuff can happen. You need to resize buffers as you read data, you need to know the escaping rules of each field, you need to know about line continuations, you have to know the text encoding, and many many other things.
Binary data in the abstract form has three elements: tag/type (may be inferred from position), data length (may be inferred from tag) and optional data itself. There are various ways to compose that information, but that's it otherwise. Binary protocols may be harder to read for people (you can just use wireshark dissectors though), but writing a correct and bug free de/encoder for one is massively simpler than for a text one.
By design, every text protocol will require more documentation than binary, because you need to include information about data escaping and encoding.
If you want to see this in practice, implement a client for something which does support both options. I recommend memcache.
The Office "binary format" is simply the objects as they exist in-memory serialized to the disk. Doing it this way was a design decision made when machines were a lot more resource constrained, and fair enough, perhaps it could be revisited, but it was made for sensible reasons by people smarter than you.
I'm sold. What would be the easiest way to makes this happen for someone like me with a pretty vanilla LAMP server?
I don't know where you saw that nginx commercial has HTTP/2 (it's not mentioned on the nginx feature matrix[1]), but their announcement[2] stated that both open and commercial versions would be getting HTTP/2 support by end of year.
Websockets are still important if you need something like real-time input-event streaming (e.g. for an online game); a properly-structured binary protocol sent over a websocket will be much lower-overhead than the equivalent HTTP/2 frames.
If you use WebSockets for "realtime push", then HTTP/2's server push feature could potentially be used as an alternative (though I've not heard of anyone actually doing this yet).
If you use WebSockets because you actually want a bidirectional message-oriented transport protocol, well then you'll keep using WebSockets. :)
One thing to keep in mind with HTTP/2 server push is that a server can only send a push in response to a client request. So this isn't a drop-in "real-time push" mechanism. To implement the equivalent of real-time push would likely require client/server to keep a stream within the connection in the "open" state whereby the server can send continue to send data frames on that.
One thing to keep in mind with HTTP/2 server push is that a server can only
send a push in response to a client request.
This was the difference that I was not aware of, thanks. So HTTP/2 server push is just opportunistic, while WebSockets are real-time push with a persistent connection.It's not like Back/Forward browser buttons are overrode to behave and previous/next for the slide presentation.
Remember those horrible embedded Flash presentations that you couldn't directly link to a particular slide within the blob? Yeah, that "breaks the Web". Back/Forward is supposed to go back to the previous page the user was on (which is a "slide" in this case).
Using Chrome 43.0.2357.81 (64-bit) / OS X.
In the scrolling case, I still don't see how it's "overriding the browser buttons", but rather having a JavaScript that advances to the next page on scroll.
In the scrolling scenario, my actual back and forward browser buttons behaved as expected — just for the pages (slides) I visited. No more, no less.
Going to a new tab in Chrome, navigating to <https://docs.google.com/presentation/d/1r7QXGYOLCh4fcUq0jDdD..., and clicking my browser's "back" button takes me back to the New Tab Page, so I'm not sure I'm seeing the behaviour you're describing.
There should be a "share" button that spites out the URL with the hash-tag of the current slide - similar to Youtube where you can click on the "share" button below the video to link to a specific time in the video, e.g. https://youtu.be/I26EwcssMbY?t=1m37s
If you find yourself having to interact with these a lot, which I do, you might find it useful to click on the cogwheel icon at the bottom of the screen and select 'Open in editor'. That gives you a completely different and IMO much easier to read view of the same document:
https://docs.google.com/presentation/d/1r7QXGYOLCh4fcUq0jDdD...
You could argue that every link should open in a new tab by default and only replace the contents of the current tab in special cases, instead of the other way around. In the past 20 years we've been 'trained' to have different expectations, because of the design of the first websites, browsers and the resource limitations of those days. However, the designs and abilities of all of those have changed and it may be worthwhile to reconsider the current default.
Firstly, the presentation seems to start by arguing that round-trip latency has much more of an impact on perceived performance than bandwidth, but then argues for several techniques whose principle advantage is saving small amounts of bandwidth. So how much improvement will these new techniques really offer over current best practices for "an average web site"?
Secondly, the presentation seems to argue that simplifying front-end development processes by avoiding things like resource concatenation is a big advantage of HTTP/2, yet despite repeatedly emphasizing the need for the server to provide just the right responses to make HTTP/2 work well, it almost completely ignores the inevitable challenges of actually configuring and maintaining a server to take advantage of all of these new techniques in a real, production environment, with rapidly evolving site structure and content, numerous contributors, etc.
Essentially, this seems to be advocacy for dumping tried, tested, universal "workarounds" for the limitations of HTTP/1.1 in favour of new techniques that work well with HTTP/2 and only HTTP/2, but as an industry we have relatively little experience in what actually works well or doesn't with HTTP/2 and we have relatively few tools and relatively little infrastructure available that support it right now. And crucially, making the shift is not by any means a neutral activity; it is actively and severely harmful to several of the most important tried-and-tested techniques we've used up to now.
Finally, there is the simple matter of trust or, if you want to be kinder, future-proofing. The presentation notes that Google are deprecating SPDY from early 2016. That is the supposed HTTP replacement that was the New Shiny... yesterday, I think, or maybe it was the day before. When arguing for fundamental and irreversible changes in the basic development process and infrastructure set-up, you lose all credibility when your so-called standards fall out of favour faster than a GUI or DB library from Microsoft, and when your own browser frequently breaks due to questionable caching and related behaviour.
It's certainly true that HTTP/1.1 isn't perfect and there are practical ways it could be improved, but I don't think this presentation makes a strong case for adopting HTTP/2 as the way forward.
[1] YMMV if you actually do work for Google/Facebook/Amazon, and you really do have practically unlimited resources available to maintain both your sites and your servers, and you really are making/losing significant amounts of money with every byte/millisecond difference.
> It's certainly true that HTTP/1.1 isn't perfect and there are practical ways it could be improved, but I don't think this presentation makes a strong case for adopting HTTP/2 as the way forward.
Well, I read it more as a "If you are planning to use HTTP/2, here are ways in which you might want to alter how you plan out your service", not "You should use HTTP/2, now here's the stuff you need to go change so you can do so." Alternatively it can see it as "here's the performance hacks you no longer have to do with HTTP/2 because it has good mechanisms for this built in." In any case, I didn't get a strong vibe about how we need to abandon HTTP 1.1.
1: http://en.wikipedia.org/wiki/HTTP/2#Genesis_in_and_later_dif...
That may always have been the intent, but I'm not sure that was clear to those outside the Google bubble.
For example, there were numerous articles and blog posts and conference talks around the time that SPDY became a serious proposition with a similar tone to the HTTP/2 commentary we are seeing today. No doubt there were exceptions, but much of that advocacy didn't exactly come with "big red box on the first slide" warnings that SPDY was an experiment, and readers/viewers should only use it in production if they had the resources available to update things again in the relatively near future.
I do appreciate that the big news for HTTP/2 is that it has reached a more formal level of standardisation, but in the modern Web industry when browsers do whatever they want every six weeks anyway, that isn't worth as much as it used to be.
Even today, there are few production-grade tools around that actually support HTTP/2 in anything close to its final form, including a lot of the projects that do support SPDY. Phasing out browser-side support for the latter as soon as early 2016 seems like a typically aggressive Google drive to shift the web to a new technology it favours, at the expense of forcing everyone to adjust/upgrade their existing working deployments. I'm very uncomfortable about how readily they are willing to do that in their browser these days, but I don't think the permanent-beta mentality has any place in server/network infrastructure at all.
SPDY was never meant to be "the supposed HTTP replacement". It was clear from the start that it was an experiment, designed to research alternative protocols and inform the design of some future hypothetical HTTP/2.0 - which it did, since they actually used SPDY as its base.
And, hopefully, Google's experimentations in other protocols and domains will challenge those controlling the status quo to adapt to the times as well. Not holding my breath but it would be nice.
But changing an existing production site so it no longer uses techniques like spriting and concatenation will damage performance if anything degrades the communications to HTTP/1.1.
One point of standardizing HTTP/2 was to let the more conservative among us start to use it now.
I'm not sure anyone who is switching to HTTP/2 today could reasonably be called "conservative". There are few production-level servers available yet, and some of the big potential performance wins due to the multiplexing, prioritisation and server push aspects -- the things that in theory could render those spriting and concatenation techniques obsolete -- are barely even mentioned right now outside of the standards documentation and related announcements. I just spent a few minutes searching to see how you'd actually configure a web server to implement customised server push for maximum performance, and I literally didn't find a single explanation, nor for that matter a single server even advertising the capability.
I'm happy for you that you got those kinds of results just from the switch to SPDY. None of the experiments I've seen did that well, but of course the benefits for these new protocols will depend on the specifics for each individual site.
Just to be clear, my main concern here isn't so much the protocol itself as the effect it has on all the infrastructure that is built around it and the implications for compatibility and long-term stability.
For example, there have been calls for various kinds of compression/encryption to be required. Then CRIME happened, and it turned out that using gzip compression within an encrypted stream wasn't such a good idea after all. What if the new standards had baked in that kind of security flaw?
There is also a whole industry of network monitoring tools used for intrusion protection, virus scanning, fault diagnostics, and many other useful applications. How many of those tools will work with these new protocols?
What about cache/proxy tools? Just as there are still few options for production-level servers that cope with HTTP/2, there is also a whole range of intermediary tools that serve useful purposes but don't currently have HTTP/2 counterparts.
For everyone else, it's optional. 2 has mandatory TLS in browsers (that's how the browser vendors are making it), so random proxies and so on just remain ignorant to it.
From an implementor's POV, 2 is easier to implement than 1. The new feature complexity is balanced by having sane parsing rules.
And remember: We've (the Internet) have been using SPDY for a couple years now. That's a very long beta period and gave everyone plenty of time to play around, raise objections, write software, etc.
If the entire GET request fits into pkt0 then there is a noticeable improvement in round-trips.
1: http://www.isi.edu/nsnam/DIRECTED_RESEARCH/DR_WANIDA/DR/imag...
http://chimera.labs.oreilly.com/books/1230000000545/ch12.htm...
* one tcp connection per request
* Server push functionality / server initiated streams
* current implementations means http/2 works over tls _only_ - neither Firefox nor chrome currently support non encrypted connections. This does keep things simpler with things like proxies in the middle I presume also.
* tls implementations must now support sni also so basically http/2 is now a forcing function for supporting sni which is awesome.
The listing itself is somewhat muddled ... "Twitter" is an entry, linking to the Twitter homepage, presumably that's responsible for most of this traffic? I found https://github.com/twitter/netty-http2 and https://github.com/twitter/hpack on Twitter's GitHub.