54
What HTTP/2.0 will* do for you Mark Nottingham http://www.mnot.net/ or, @mnot TO __

What HTTP/2.0 Will Do For You

Embed Size (px)

DESCRIPTION

An overview of where HTTP/2.0 is at and what it might mean for how we deploy and operate the Web, from the chair of the IETF HTTPbis Working Group.

Citation preview

Page 1: What HTTP/2.0 Will Do For You

What HTTP/2.0 will*

do for you

Mark Nottinghamhttp://www.mnot.net/

or, @mnot

TO__

Page 2: What HTTP/2.0 Will Do For You

forward-looking statement

A projected financial statement based on management expectations. A forward-looking statement involves risks with regard to the accuracy of assumptions underlying the projections. Discussions of these statements typically include words such as estimate, anticipate, project, and believe.

*___TECHNICAL

Page 3: What HTTP/2.0 Will Do For You

1. Some recent history

Page 4: What HTTP/2.0 Will Do For You

IETF HTTPbis WGWHAT? to clarify RFC2616 and improve interop

WHO? Roy Fielding, Julian Reschke

WHO (2)? Apache, Mozilla, Chrome, IIS, Varnish, Squid, F5, Curl, ATS, IE, HAProxy...

WHEN: Almost finished!

WHEN (2): ... after FIVE YEARS :(

Page 5: What HTTP/2.0 Will Do For You

IETF HTTPbis WG (2)

STRICTLY chartered to avoid making a new version of the protocol.

Because EVERYBODY knows that’s not going to happen.

Page 6: What HTTP/2.0 Will Do For You

MEANWHILE

Page 7: What HTTP/2.0 Will Do For You

November 2009: Mike Belshe and Roberto Peon announce SPDY

March 2011: Mike talks about SPDY to the HTTPbis WG at IETF80

~April 2011: Chrome, Google start using SPDY

March 2012: HTTPbis solicits proposals for new protocol work

March 2012: Firefox 11 ships with SPDY (off by default)

May 2012: Netcraft finds 339 servers that support SPDY

June 2012: Nginx announces SPDY implementation

July 2012: Akamai announces SPDY implementation

Tuesday: HTTPbis re-chartered to work on HTTP/2.0, based on SPDY

Page 8: What HTTP/2.0 Will Do For You

2. What is it?

Page 9: What HTTP/2.0 Will Do For You

NO change to HTTP semantics; it’s about how it gets onto the wire

Page 10: What HTTP/2.0 Will Do For You

Nothing newto see here

Page 11: What HTTP/2.0 Will Do For You

Not magic

Page 12: What HTTP/2.0 Will Do For You

1.multiplexing

2.header compression

3.server push (?)

4.TLS (?)

Page 13: What HTTP/2.0 Will Do For You

2.1 multiplexing

Page 14: What HTTP/2.0 Will Do For You

GET /foo

200 OK

vanillaHTTP/1.0

One requestper TCP connection

clie

nt

serverconnection close

connection setup

OMG ITS SO SLOW

Page 15: What HTTP/2.0 Will Do For You

GET /foo

GET /bar

200 OK

200 OK

HTTP/1.0(with Keep-Alive)

GET /baz

able to reuseconnections, avoidconnection setup

Page 16: What HTTP/2.0 Will Do For You

GET /foo

GET /bar

200 OK

200 OK

BUTit still blocks

GET /baz

one outstanding request at a time

Page 17: What HTTP/2.0 Will Do For You

GET /fooGET /bar

200 OK

200 OK HTTP/1.1

multiple, orderedrequests

(with pipelining)

GET /baz

200 OK

Page 18: What HTTP/2.0 Will Do For You

head-of-line blocking

GET /fooGET /bar

200 OK

200 OKStill serialised!Large downloads / long “think” time can block other requests

Page 19: What HTTP/2.0 Will Do For You

The State of the Art• Use persistent connections (“keep-alives”)

• Pipelining is getting a little deployment

• Use multiple connections for parallelism

• RFC2616 said “2”; HTTPbis says “reasonable”

• Browsers use 4-8; bad people use more

• Build lots of heuristics into browsers for connection reuse

• Hope that it all works out

Page 20: What HTTP/2.0 Will Do For You

What’s so bad about that?

• TCP is built for long-lived flows

• More connections = shorter flows

• Congestion control doesn’t have time to ramp up

• Makes Buffer Bloat worse

• Fairness (user to user, app to app)

• How many connections is the best?

Page 21: What HTTP/2.0 Will Do For You

cascading waterfalls

four at a time

Page 22: What HTTP/2.0 Will Do For You

SPDYmultiplexing

GET /foo

GET /bar

200 OK

• one connection• many requests• prioritisation• out of order• interleaved

GET /baz

GET /a

GET /b

GET /c

200 OK

200 OK

200 OK

200 OKNO* QUEUING

Page 23: What HTTP/2.0 Will Do For You

2.2 header compression

Page 24: What HTTP/2.0 Will Do For You

GET / HTTP/1.1Host: www.etsy.comUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8DNT: 1Accept-Language: en-usAccept-Encoding: gzip, deflateCookie: uaid=uaid%3DVdhk5W6sexG-_Y7ZBeQFa3cq7yMQ%26_now%3D1325204464%26_slt%3Ds_LCLVpU%26_kid%3D1%26_ver%3D1%26_mac%3DlVnlM3hMdb3Cs3hqMVuk_dQEixsqQzUlNYCs9H_Kj8c.; user_prefs=1&2596706699&q0tPzMlJLaoEAA==Connection: keep-alive

525 bytes

Page 25: What HTTP/2.0 Will Do For You

GET /assets/dist/js/etsy.recent-searches.20121001205006.js HTTP/1.1Host: www.etsy.comUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14Accept: */*DNT: 1Referer: http://www.etsy.com/Accept-Language: en-usAccept-Encoding: gzip, deflateCookie: autosuggest_split=1; etala=111461200.1476767743.1349274889.1349274889.1349274889.1.0; etalb=111461200.1.10.1349274889; last_browse_page=%2F; uaid=uaid%3DVdhk5W6sexG-_Y7ZBeQFa3cq7yMQ%26_now%3D1325204464%26_slt%3Ds_LCLVpU%26_kid%3D1%26_ver%3D1%26_mac%3DlVnlM3hMdb3Cs3hqMVuk_dQEixsqQzUlNYCs9H_Kj8c.; user_prefs=1&2596706699&q0tPzMlJLaoEAA==Connection: keep-alive

226 new bytes; 690 total

Page 26: What HTTP/2.0 Will Do For You

GET /assets/dist/js/jquery.appear.20121001205006.js HTTP/1.1Host: www.etsy.comUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14Accept: */*DNT: 1Referer: http://www.etsy.com/Accept-Language: en-usAccept-Encoding: gzip, deflateCookie: autosuggest_split=1; etala=111461200.1476767743.1349274889.1349274889.1349274889.1.0; etalb=111461200.1.10.1349274889; last_browse_page=%2F; uaid=uaid%3DVdhk5W6sexG-_Y7ZBeQFa3cq7yMQ%26_now%3D1325204464%26_slt%3Ds_LCLVpU%26_kid%3D1%26_ver%3D1%26_mac%3DlVnlM3hMdb3Cs3hqMVuk_dQEixsqQzUlNYCs9H_Kj8c.; user_prefs=1&2596706699&q0tPzMlJLaoEAA==Connection: keep-alive

14 new bytes; 683 total

Page 27: What HTTP/2.0 Will Do For You

GET /assets/dist/js/bootstrap/username-suggester.20121001205006.js HTTP/1.1Host: www.etsy.comUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14Accept: */*DNT: 1Referer: http://www.etsy.com/Accept-Language: en-usAccept-Encoding: gzip, deflateCookie: autosuggest_split=1; etala=111461200.1476767743.1349274889.1349274889.1349274889.1.0; etalb=111461200.1.10.1349274889; last_browse_page=%2F; uaid=uaid%3DVdhk5W6sexG-_Y7ZBeQFa3cq7yMQ%26_now%3D1325204464%26_slt%3Ds_LCLVpU%26_kid%3D1%26_ver%3D1%26_mac%3DlVnlM3hMdb3Cs3hqMVuk_dQEixsqQzUlNYCs9H_Kj8c.; user_prefs=1&2596706699&q0tPzMlJLaoEAA==Connection: keep-alive

28 new bytes; 698 total

Page 28: What HTTP/2.0 Will Do For You

• Four requests

• 2,596 bytes total

• Minimum three packets in most places

• One for the HTML, two+ for assets

• 1,797 redundant bytes

Page 29: What HTTP/2.0 Will Do For You

HTTP headers on a connection are highly similar

Page 30: What HTTP/2.0 Will Do For You

Request URI

User-Agent

Cookies

Referer

Page 31: What HTTP/2.0 Will Do For You

• Patrick’s test:

• 83 asset requests

• IW = 3

• ~1400 bytes of headers

• Uncompressed: 7-8RT

• Compressed (zlib): 1RT

Big req * many reqs / small IW = SLOW

Page 32: What HTTP/2.0 Will Do For You

2.3 server push (?)

Page 33: What HTTP/2.0 Will Do For You

2.4 TLS?

Page 34: What HTTP/2.0 Will Do For You

3. What does it all mean?

Page 35: What HTTP/2.0 Will Do For You

HTTP/2.0 is going to change Web Engineering...

Page 36: What HTTP/2.0 Will Do For You

... but not change HTTP APIs. Much.

Page 37: What HTTP/2.0 Will Do For You

Leaky Abstractions

Page 38: What HTTP/2.0 Will Do For You

Reduce Requests

Page 39: What HTTP/2.0 Will Do For You

• Image spriting - not necessary

• CSS / JS can be in multiple files

• HTTP APIs can be finer-grained without sacrificing performance

• Third party content is an even bigger problem

Page 40: What HTTP/2.0 Will Do For You

Domain Sharding

Page 41: What HTTP/2.0 Will Do For You

• Multiplexing SHOULD make multiple connections unnecessary

• Key is to get the TCP connection “warm” as quickly as possible, and keep it there

Page 42: What HTTP/2.0 Will Do For You

Header Optimisation

Page 43: What HTTP/2.0 Will Do For You

• Now, adding new headers is easy

• Very small performance / latency /bandwidth impact

• What should be in headers can be in headers

• Content Negotiation might become interesting again

Page 44: What HTTP/2.0 Will Do For You

Predictability

Page 45: What HTTP/2.0 Will Do For You

Better Error Handling

Page 46: What HTTP/2.0 Will Do For You

Debugging willneed Tools

Page 47: What HTTP/2.0 Will Do For You

Lots of tweaking• Prioritisation

• When to Push

• Flow Control

Page 48: What HTTP/2.0 Will Do For You

Transition Decisions

• De-sharding

• De-combining scripts

• De-spriting

• etc.

Page 49: What HTTP/2.0 Will Do For You

Guess what,

Steve?

Absurdly FastWeb Sites. Fast.

Page 50: What HTTP/2.0 Will Do For You

4. What’s still wrong

Page 51: What HTTP/2.0 Will Do For You

4.1 Security is hard

Page 52: What HTTP/2.0 Will Do For You

4.2 TCP is awkward• In-order delivery = head-of-line blocking

• Initial congestion window is small

• Packet loss isn’t handled well

Page 53: What HTTP/2.0 Will Do For You

HTTP as the “Everything Protocol”

?

Page 54: What HTTP/2.0 Will Do For You

Some Links

http://bit.ly/httpbis-home

http://www.chromium.org/spdy

http://www.mnot.net/