Is the Web HTTP/2 yet? Jeremy Blackburn and Ma<eo - - PowerPoint PPT Presentation

is the web http 2 yet
SMART_READER_LITE
LIVE PREVIEW

Is the Web HTTP/2 yet? Jeremy Blackburn and Ma<eo - - PowerPoint PPT Presentation

Is the Web HTTP/2 yet? Jeremy Blackburn and Ma<eo Varvello K. Schomp, D. Naylor, A. Finamore, K. Papagiannaki Outline HTTP History


slide-1
SLIDE 1

Is ¡the ¡Web ¡HTTP/2 ¡yet? ¡

Jeremy ¡Blackburn ¡and ¡Ma<eo ¡Varvello ¡

  • K. ¡Schomp, ¡D. ¡Naylor, ¡A. ¡Finamore, ¡K. ¡Papagiannaki ¡

¡ ¡ ¡ ¡

slide-2
SLIDE 2

Outline ¡

  • HTTP ¡History ¡
  • HTTP/2 ¡Background ¡ ¡
  • What, ¡why ¡and ¡how? ¡ ¡
  • HTTP/2 ¡AdopMon ¡ ¡
  • HTTP/2 ¡Content ¡Analysis ¡
  • HTTP/2 ¡Performance ¡Analysis ¡ ¡
slide-3
SLIDE 3

History ¡ ¡

1965 ¡

  • Hypertext, ¡HTTP, ¡World ¡Wide ¡Web ¡
  • HTTP ¡funcMons ¡as ¡a ¡request–response ¡

protocol ¡in ¡the ¡client–server ¡compuMng ¡ model ¡ ¡

slide-4
SLIDE 4

History ¡ ¡

  • TCP ¡connecMon ¡on ¡port ¡80 ¡ ¡
  • ASCII ¡protocol ¡ ¡

– Simply ¡telnet ¡(1969) ¡for ¡debugging ¡ ¡

  • Only ¡one ¡method: ¡GET ¡

– GET ¡an ¡HTML ¡page ¡from ¡a ¡server ¡

1965 ¡

slide-5
SLIDE 5

History ¡ ¡

  • RFC1945 ¡describes ¡the ¡“common ¡usage’” ¡of ¡HTTP/1.0, ¡

not ¡a ¡formal ¡standard ¡ ¡

  • Introduce ¡POST ¡and ¡HEAD ¡ ¡
  • Content-Encoding header ¡

– end-­‑to-­‑end ¡content-­‑coding(s) ¡used ¡for ¡a ¡message ¡

  • Simple ¡caching ¡ ¡

– server ¡may ¡mark ¡a ¡response ¡using ¡the ¡Expires ¡header ¡ – cache ¡can ¡include ¡If-Modified-Since header ¡to ¡ check ¡cache ¡validity ¡ ¡

1965 ¡

slide-6
SLIDE 6

History ¡ ¡

  • IETF ¡Drae ¡Standard ¡
  • Add ¡methods: ¡OPTIONS, ¡PUT, ¡DELETE, ¡TRACE ¡and ¡CONNECT ¡

– HTTPS ¡through ¡HTTP ¡proxy ¡

  • Pipelining ¡

– MulMple ¡request ¡over ¡a ¡single ¡(TCP) ¡connecMon ¡ ¡

  • New ¡header ¡opMons ¡

– Range ¡requests ¡ – Hop-­‑by-­‑hop ¡headers ¡

  • Clarify ¡and ¡add ¡flexibility ¡to ¡caching ¡operaMons ¡
  • Upgrade ¡request ¡header ¡

– Ease ¡deployment ¡of ¡future ¡protocols ¡

1965 ¡ 2000 ¡

slide-7
SLIDE 7

History ¡ ¡

1965 ¡ 2000 ¡

Number of Domains

Breakdown by Protocol Version (Announced Support)

Click and drag in the plot area to zoom in H2 Draft 14

Jan '15 Jan '16 May '15 Sep '15 0k 20k 40k 60k 80k

Highcharts.com

2014-­‑2015 ¡

slide-8
SLIDE 8

History ¡ ¡

1965 ¡ 2000 ¡

Number of Domains

Breakdown by Protocol Version (Announced Support)

Click and drag in the plot area to zoom in H2 Draft 14 H2 Draft 15 H2 Draft 16 H2 Draft 17

Jan '15 Jan '16 May '15 Sep '15 0k 20k 40k 60k 80k

Highcharts.com

2014-­‑2015 ¡

slide-9
SLIDE 9

History ¡ ¡

1965 ¡ 2000 ¡

Number of Domains

Breakdown by Protocol Version (Announced Support)

Click and drag in the plot area to zoom in H2 Draft 14 H2 Draft 15 H2 Draft 16 H2 Draft 17 H2

Jan '15 Jan '16 May '15 Sep '15 0k 50k 100k 150k 200k

Highcharts.com

2014-­‑2015 ¡

slide-10
SLIDE 10

Outline ¡

  • HTTP ¡History ¡
  • HTTP/2 ¡Background ¡ ¡
  • What, ¡why ¡and ¡how? ¡ ¡
  • HTTP/2 ¡AdopMon ¡ ¡
  • HTTP/2 ¡Content ¡Analysis ¡
  • HTTP/2 ¡Performance ¡Analysis ¡ ¡
slide-11
SLIDE 11

Binary ¡Protocol ¡ ¡

  • H2 ¡is ¡binary ¡rather ¡than ¡ASCII ¡ ¡
  • Pros: ¡

– efficient ¡parsing ¡ – lighter ¡network ¡footprint ¡ – less ¡prune ¡to ¡security ¡issues ¡due ¡to ¡unsaniMzed ¡ input ¡strings ¡

slide-12
SLIDE 12

Header ¡Compression ¡ ¡

  • HTTP ¡is ¡state-­‑less, ¡thus ¡repeMMve ¡

– Each ¡object ¡needs ¡to ¡carry ¡header ¡informaMon ¡ ¡ – HTTP/2 ¡is ¡state-­‑less ¡as ¡well ¡

  • HTTP/2 ¡reduces ¡redundant ¡informaMon ¡

shared ¡between ¡objects ¡using ¡compression ¡ ¡

– HPACK7: ¡solve ¡BREACH ¡and ¡CRIME ¡ vulnerabiliMes ¡with ¡SPDY ¡(gzip) ¡

slide-13
SLIDE 13

MulMplexing ¡

  • Head ¡of ¡line ¡blocking ¡– ¡Any ¡early ¡

request ¡for ¡a ¡large ¡object ¡can ¡ ¡ delay ¡all ¡subsequent ¡pipelined ¡ ¡ requests ¡

– Clients ¡open ¡several ¡TCP ¡connecMons ¡in ¡parallel ¡(6 ¡in ¡ Chrome ¡and ¡15 ¡in ¡Firefox) ¡ ¡ – Overhead ¡of ¡mulMple ¡TCP ¡connecMons ¡(TCP ¡state, ¡TLS ¡ handshake ¡and ¡setup) ¡ ¡

  • H2 ¡opens ¡a ¡single ¡TCP ¡connecMon ¡to ¡a ¡domain ¡where ¡

it ¡mul%plexes ¡requests ¡and ¡responses ¡(streams) ¡ ¡

slide-14
SLIDE 14

Priority ¡ ¡

  • A ¡client ¡can ¡specify ¡which ¡streams ¡are ¡most ¡

important ¡ ¡

  • It ¡allows ¡the ¡client ¡to ¡load ¡important ¡objects ¡

(e.g., ¡CSS ¡and ¡JavaScript) ¡earlier ¡

slide-15
SLIDE 15

Push ¡ ¡

  • It ¡allows ¡the ¡server ¡to ¡push ¡objects ¡before ¡the ¡

client ¡requests ¡them ¡

– Server ¡knows ¡what ¡the ¡client ¡will ¡ask ¡in ¡the ¡future ¡ ¡

slide-16
SLIDE 16

HTTP/2 ¡Background ¡– ¡Summary ¡ ¡

  • Binary ¡protocol ¡– ¡efficient ¡parsing, ¡light ¡network ¡

footprint, ¡less ¡prune ¡to ¡security ¡issues ¡due ¡to ¡ unsaniMzed ¡input ¡strings ¡

  • Header ¡compression ¡– ¡reduces ¡redundant ¡informaMon ¡

shared ¡between ¡objects ¡

  • Mul%plexing ¡– ¡opens ¡a ¡single ¡TCP ¡connecMon ¡to ¡a ¡

domain ¡where ¡it ¡mul%plexes ¡requests ¡and ¡responses ¡ ¡

  • Priority ¡– ¡allows ¡the ¡client ¡to ¡load ¡important ¡objects ¡

(e.g., ¡CSS ¡and ¡JavaScript) ¡earlier ¡

  • Server ¡push ¡– ¡allows ¡the ¡server ¡to ¡push ¡objects ¡before ¡

the ¡client ¡requests ¡them ¡

slide-17
SLIDE 17

Outline ¡

  • History ¡
  • HTTP/2 ¡Background ¡ ¡
  • What, ¡Why ¡and ¡How? ¡ ¡
  • HTTP/2 ¡AdopMon ¡ ¡
  • HTTP/2 ¡Content ¡Analysis ¡
  • HTTP/2 ¡Performance ¡Analysis ¡ ¡
slide-18
SLIDE 18

What? ¡

  • Monitored ¡HTTP/2 ¡(H2) ¡adopMon ¡ ¡

– Alexa ¡top ¡1 ¡million* ¡websites ¡on ¡a ¡daily ¡basis ¡ ¡

  • Content ¡and ¡performance ¡analysis ¡ ¡

– Subset ¡of ¡website ¡“truly” ¡supporMng ¡H2 ¡

  • Built ¡a ¡website ¡ ¡

– h<p://isthewebh<p2yet.com/ ¡

slide-19
SLIDE 19

Why? ¡

  • Who ¡is ¡behind ¡H2? ¡ ¡

– Unique ¡chance ¡to ¡understand ¡how ¡a ¡new ¡protocol ¡ is ¡adopted ¡in ¡the ¡modern ¡Web ¡

  • Is ¡H2 ¡bringing ¡any ¡performance ¡benefit? ¡ ¡
  • Did ¡web ¡content ¡change ¡with ¡H2 ¡adopMon? ¡ ¡

– Are ¡H1 ¡hack ¡(e.g., ¡inlining ¡and ¡domain ¡sharding) ¡sMll ¡ used? ¡

  • Is ¡there ¡any ¡interest ¡in ¡H2-­‑in-­‑the-­‑clear ¡(H2C)? ¡ ¡
slide-20
SLIDE 20

How? ¡ ¡

slide-21
SLIDE 21

Phase ¡1 ¡

  • Challenges ¡are ¡scale ¡and ¡speed ¡ ¡

– Alexa’s ¡top ¡1M, ¡daily ¡

  • We ¡build ¡prober ¡

– ¡Bash ¡tool ¡for ¡ALPN/ ¡ NPN ¡negoMaMons ¡ – ¡Run ¡on ¡PlanetLab ¡

instrumented ¡by ¡a ¡ “tracker” ¡

slide-22
SLIDE 22

Phase ¡2 ¡

  • Small(er) ¡scale ¡(for ¡now) ¡ ¡

– FracMon ¡of ¡sites ¡announcing ¡H2 ¡support ¡ ¡

  • We ¡build ¡h2-­‑lite ¡

– a ¡Mny ¡H2 ¡client ¡that ¡a<empts ¡to ¡download ¡the ¡ root ¡object ¡of ¡a ¡website ¡using ¡H2 ¡ – H2 ¡library ¡implemented ¡in ¡Node.js ¡

  • Run ¡from ¡Telefonica ¡(Spain) ¡and ¡CMU ¡(USA) ¡ ¡

¡

slide-23
SLIDE 23

Phase ¡3 ¡

  • Small ¡scale ¡(for ¡now) ¡ ¡

– FracMon ¡of ¡sites ¡with ¡cerMfied ¡H2 ¡support ¡

  • Require ¡full ¡machine ¡control: ¡result ¡

reproducibility, ¡3/4g ¡dongle, ¡etc. ¡ ¡

  • We ¡build ¡chrome-­‑loader ¡ ¡

– Loads ¡pages ¡using ¡Chrome ¡and ¡H1/H2 ¡alternaMvely ¡ for ¡N ¡repeMMons ¡ – HAR ¡retrieval ¡via ¡Chrome ¡developer ¡interface ¡ – Error/crash ¡management ¡ ¡

  • It ¡runs ¡from ¡Telefonica ¡(Barcelona, ¡Spain), ¡Case ¡

(Cleveland, ¡USA) ¡and ¡CMU ¡(Pi<sburgh, ¡USA) ¡ ¡

slide-24
SLIDE 24

LimitaMons ¡

  • Loca:on ¡– ¡H2 ¡adopMon ¡can ¡be ¡impacted ¡by ¡locaMon, ¡

e.g., ¡Facebook ¡ ¡

– Phase ¡1 ¡tasks ¡are ¡randomly ¡assigned ¡by ¡locaMon ¡(for ¡ scalability) ¡ ¡

  • Limited ¡vantage ¡points ¡– ¡Phase-­‑3 ¡only ¡runs ¡from ¡a ¡

handful ¡of ¡locaMons ¡

  • Scalability ¡– ¡already ¡facing ¡this ¡issue ¡with ¡phase ¡3 ¡

– Increase ¡vantage ¡points ¡ ¡ – Rethink/opMmize ¡(see ¡lazy ¡strategy ¡in ¡the ¡paper) ¡ ¡

  • PLT ¡ ¡== ¡onLoad() ¡– ¡though ¡this ¡metric ¡is ¡well-­‑known ¡

and ¡largely ¡used, ¡it ¡is ¡quesMonable ¡in ¡the ¡modern ¡web ¡

slide-25
SLIDE 25

Outline ¡

  • History ¡
  • HTTP/2 ¡Background ¡ ¡
  • What, ¡Why ¡and ¡How? ¡ ¡
  • HTTP/2 ¡AdopMon ¡ ¡
  • HTTP/2 ¡Content ¡Analysis ¡
  • HTTP/2 ¡Performance ¡Analysis ¡ ¡
slide-26
SLIDE 26

AdopMon ¡

slide-27
SLIDE 27

AdopMon ¡

h<p://isthewebh<p2yet.com/measurements/adopMon.html ¡

slide-28
SLIDE 28

Outline ¡

  • History ¡
  • HTTP/2 ¡Background ¡ ¡
  • What, ¡Why ¡and ¡How? ¡ ¡
  • HTTP/2 ¡AdopMon ¡ ¡
  • HTTP/2 ¡Content ¡Analysis ¡
  • HTTP/2 ¡Performance ¡Analysis ¡ ¡
slide-29
SLIDE 29

Content ¡Analysis ¡– ¡Marcoscopic ¡

slide-30
SLIDE 30

Content ¡Analysis ¡-­‑-­‑ ¡Marcoscopic ¡

No ¡significant ¡ change ¡over ¡ Mme ¡

slide-31
SLIDE 31

Content ¡Analysis ¡– ¡Marcoscopic ¡

No ¡significant ¡ change ¡over ¡ Mme ¡

More ¡complex ¡ websites ¡adopt ¡ H2 ¡over ¡Mme ¡

slide-32
SLIDE 32

Content ¡Analysis ¡– ¡Microscopic ¡

50th: ¡18 ¡dom ¡

slide-33
SLIDE 33

Content ¡Analysis ¡– ¡Microscopic ¡

50th: ¡3 ¡obj ¡

slide-34
SLIDE 34

Outline ¡

  • History ¡
  • HTTP/2 ¡Background ¡ ¡
  • What, ¡Why ¡and ¡How? ¡ ¡
  • HTTP/2 ¡AdopMon ¡ ¡
  • HTTP/2 ¡Content ¡Analysis ¡
  • HTTP/2 ¡Performance ¡Analysis ¡ ¡
slide-35
SLIDE 35

TCP ¡Analysis ¡

On ¡average, ¡H2 ¡ requires ¡half ¡as ¡ many ¡TCP ¡ connec:ons ¡as ¡H1 ¡

slide-36
SLIDE 36

TCP ¡Analysis ¡

Few ¡sites ¡can ¡be ¡ served ¡via ¡a ¡ single ¡TCP ¡ connec:on ¡ ¡

On ¡average, ¡H2 ¡ requires ¡half ¡as ¡ many ¡TCP ¡ connecMons ¡as ¡H1 ¡

slide-37
SLIDE 37

TCP ¡Analysis ¡

As ¡high ¡as ¡100 ¡ TCP ¡connec:ons ¡

On ¡average, ¡H2 ¡ requires ¡half ¡as ¡ many ¡TCP ¡ connecMons ¡as ¡H1 ¡

Few ¡sites ¡can ¡be ¡ served ¡via ¡a ¡ single ¡TCP ¡ connecMon ¡ ¡

slide-38
SLIDE 38

TCP ¡Analysis ¡

20-­‑40% ¡of ¡sites ¡ with ¡>= ¡80% ¡of ¡H2 ¡

  • bjects ¡are ¡served ¡

via ¡a ¡single ¡TCP ¡ connec:on ¡

slide-39
SLIDE 39

Performance ¡Analysis ¡

  • No ¡standardized ¡definiMon ¡of ¡“page ¡load ¡

Mme” ¡(PLT) ¡

– the ¡Mme ¡from ¡when ¡the ¡user ¡enters ¡a ¡URL ¡in ¡the ¡ browser ¡to ¡when ¡the ¡page ¡is ¡displayed ¡

  • We ¡approximate ¡PLT ¡as ¡the ¡Mme ¡from ¡when ¡

Chrome ¡starts ¡fetching ¡the ¡page ¡to ¡the ¡firing ¡

  • f ¡the ¡JavaScript ¡“onLoad” ¡event ¡

– occurs ¡once ¡the ¡page’s ¡embedded ¡resources ¡ have ¡been ¡downloaded, ¡but ¡possibly ¡before ¡all ¡

  • bjects ¡loaded ¡via ¡scripts ¡are ¡downloaded ¡
slide-40
SLIDE 40

Performance ¡Analysis ¡

slide-41
SLIDE 41

Performance ¡Analysis ¡

slide-42
SLIDE 42

Performance ¡Analysis ¡

25% ¡of ¡the ¡ websites ¡“suffer” ¡ due ¡to ¡h2 ¡

slide-43
SLIDE 43

Performance ¡Analysis ¡

25% ¡of ¡the ¡ websites ¡“suffer” ¡ due ¡to ¡h2 ¡

More ¡benefits ¡on ¡ more ¡challenging ¡ network ¡access ¡ (3G) ¡ ¡

slide-44
SLIDE 44

Performance ¡Analysis ¡– ¡Controlled ¡

More ¡benefits ¡as ¡ loss ¡rate ¡increases ¡ and ¡available ¡bdw ¡ decreases ¡

slide-45
SLIDE 45

The ¡Web ¡is ¡Poorly ¡Defined ¡

  • Many ¡challenges ¡to ¡measuring ¡performance ¡
  • Everyone ¡measures ¡Page ¡Load ¡Time ¡(PLT) ¡
  • PLT?!?!?!!? ¡

– “onload” ¡event ¡in ¡browser ¡

  • “onload” ¡event?!?!?! ¡

– “The ¡onload ¡event ¡occurs ¡when ¡an ¡object ¡has ¡ been ¡loaded.” ¡– ¡W3Schools ¡

slide-46
SLIDE 46

Web ¡Browser ¡Events ¡– ¡Quick ¡Info ¡

  • A ¡web ¡page ¡is ¡built ¡from ¡a ¡“DOM” ¡à ¡

“Document ¡Object ¡Model” ¡

– Root ¡Object ¡à ¡The ¡web ¡page ¡

  • <html>…</html> ¡

– Child ¡objects ¡à ¡The ¡“content” ¡

  • <body><div>Hello ¡World!</div></body> ¡
  • Browser ¡fires ¡and ¡receives ¡events ¡from/to ¡

different ¡nodes ¡in ¡the ¡DOM ¡

slide-47
SLIDE 47

“onload” ¡

  • “The ¡load ¡event ¡fires ¡at ¡the ¡end ¡of ¡the ¡

document ¡loading ¡process. ¡At ¡this ¡point, ¡all ¡of ¡ the ¡objects ¡in ¡the ¡document ¡are ¡in ¡the ¡DOM, ¡ and ¡all ¡the ¡images, ¡scripts, ¡links ¡and ¡sub-­‑ frames ¡have ¡finished ¡loading.” ¡– ¡Mozilla ¡

  • OK?!?!?!? ¡
slide-48
SLIDE 48

The ¡Problem… ¡

  • onload ¡wrt ¡PLT ¡is ¡only ¡for ¡the ¡root ¡object ¡
  • Many ¡websites ¡these ¡days ¡do ¡things ¡a>er ¡the ¡
  • nload ¡event ¡has ¡fired… ¡

¡

  • WHEN ¡IS ¡A ¡PAGE ¡ACTUALLY ¡LOADED?!?!?! ¡
slide-49
SLIDE 49

Pathological ¡Example… ¡

slide-50
SLIDE 50
slide-51
SLIDE 51

Houston, ¡We ¡Have ¡A ¡Problem… ¡

  • Yes, ¡the ¡onload ¡event ¡indicates ¡that ¡“all ¡

resources ¡are ¡loaded” ¡

  • No, ¡the ¡onload ¡event ¡does ¡not ¡mean ¡that ¡a ¡

page ¡is ¡“done” ¡as ¡far ¡as ¡humans ¡are ¡ concerned! ¡

slide-52
SLIDE 52

SpeedIndex ¡for ¡PLT ¡

  • Speed ¡Index ¡

– Uses ¡“visual ¡completeness” ¡ – Makes ¡a ¡video ¡of ¡the ¡page ¡and ¡checks ¡frame-­‑by-­‑frame ¡ – Calculates ¡area ¡under ¡the ¡“visually ¡completed” ¡curve ¡ – end ¡à ¡end ¡Mme ¡in ¡ms ¡ – VC ¡= ¡% ¡visually ¡complete ¡

  • Not ¡really ¡used ¡in ¡literature ¡that ¡we ¡can ¡tell.. ¡

SpeedIndex = 1− VC 100 end

slide-53
SLIDE 53

SMll… ¡What ¡About ¡HUMANS ¡

  • Human ¡percepMon ¡is ¡tricky… ¡

– We ¡can ¡only ¡see ¡at ¡around ¡30 ¡frames ¡per ¡second ¡ – But, ¡that ¡doesn’t ¡mean ¡we ¡can’t ¡tell ¡when ¡ something ¡is ¡slower! ¡

  • Example: ¡Speed ¡up ¡a ¡page ¡by ¡34% ¡

– 2 ¡seconds ¡to ¡load ¡à ¡1.28 ¡seconds ¡to ¡load ¡ – Does ¡it ¡actually ¡ma<er?! ¡Is ¡it ¡perceivably ¡faster?! ¡

slide-54
SLIDE 54

eyeorg.net ¡

  • Our ¡work ¡in ¡progress ¡to ¡answer ¡how ¡humans ¡

perceive ¡web ¡page ¡load ¡Mme ¡

  • Basic ¡idea: ¡we ¡crowdsource ¡human ¡eyeballs ¡

and ¡have ¡them ¡measure ¡PLT ¡in ¡a ¡variety ¡of ¡ ways ¡

  • Start ¡off ¡with: ¡“Which ¡is ¡faster?” ¡
slide-55
SLIDE 55

What ¡Do ¡We ¡Need ¡To ¡Build? ¡

  • 1. Crawler ¡
  • 2. HAR ¡Capturer ¡
  • 3. Video ¡Encoder ¡
  • 4. Frontend ¡
  • 5. Backend ¡
slide-56
SLIDE 56

Crawler ¡

  • Similar ¡to ¡the ¡HTTP/2 ¡adopMon ¡crawler ¡
  • Set ¡of ¡bash ¡scripts ¡that ¡triggers ¡crawls ¡
  • Controls ¡all ¡other ¡operaMons ¡
slide-57
SLIDE 57

HAR ¡Capturer ¡

  • HTTP ¡Archive ¡format ¡
  • www.soewareishard.com/blog/har-­‑12-­‑spec/ ¡
  • From ¡browser’s ¡perspec%ve ¡
  • JSON ¡
  • Lots ¡of ¡info! ¡

– Timing ¡ – ConnecMons ¡ – Protocols ¡ – Etc. ¡

slide-58
SLIDE 58

How ¡to ¡Capture ¡a ¡HAR? ¡

  • Not ¡that ¡simple… ¡
  • Chrome ¡allows ¡you ¡to ¡export ¡a ¡HAR ¡

– Via ¡developer ¡tools ¡ – Can’t ¡really ¡automate ¡though! ¡Requires ¡clicking… ¡

  • Chrome ¡Remote ¡Debugging ¡Protocol! ¡

– Allows ¡us ¡to ¡hook ¡into ¡Chrome ¡and ¡capture ¡ various ¡events ¡

slide-59
SLIDE 59

Chrome ¡Remote ¡Debugging ¡Protocol ¡

  • Uses ¡WebSockets ¡to ¡push ¡events ¡to ¡a ¡listener ¡

– Allows ¡full-­‑duplex ¡comms ¡over ¡an ¡HTTP ¡TCP ¡conn ¡ – NOT ¡HTTP ¡à ¡Handshake ¡treated ¡as ¡an ¡upgrade ¡

  • 1. Launch ¡chrome ¡with ¡special ¡flag ¡

– “-­‑-­‑remote-­‑debugging-­‑port=9222” ¡

  • 2. Connect ¡to ¡Chrome ¡
  • 3. Listen ¡for ¡events ¡

– All ¡different ¡types ¡of ¡events… ¡

slide-60
SLIDE 60

Remote ¡Debugging ¡Protocol ¡Messages ¡

  • JSON ¡
  • Lots ¡of ¡info ¡
  • Many ¡message ¡

types… ¡

slide-61
SLIDE 61

What ¡Events ¡Do ¡We ¡Care ¡About? ¡

  • Page.domContentEventFired

Page.domContentEventFired

– The ¡“DOMContentLoaded” ¡event ¡

  • Even ¡less ¡well ¡specified ¡than ¡“onload” ¡
  • Page.loadEventFired

Page.loadEventFired

– “onload” ¡

  • Network.requestWillBeSent

Network.requestWillBeSent

– Browser ¡will ¡make ¡a ¡network ¡request ¡

  • Network.dataReceived

Network.dataReceived

– The ¡browser ¡got ¡some ¡data ¡from ¡the ¡network ¡

  • Network.responseReceived

Network.responseReceived

– A ¡full ¡HTTP ¡response ¡is ¡available ¡

  • Network.loadingFinished

Network.loadingFinished

– HTTP ¡request ¡has ¡finished ¡loading ¡(whatever ¡that ¡means) ¡

  • Network.loadingFailed

Network.loadingFailed

– A ¡network ¡request ¡failed ¡to ¡load ¡

slide-62
SLIDE 62

Our ¡HAR ¡Capturer ¡(bkPLTHAR) ¡

  • Ruby ¡

– About ¡550 ¡LOC ¡

¡

  • Uses ¡EventMachine ¡

– Gives ¡us ¡an ¡event ¡loop ¡

  • Uses ¡Faye ¡WebSocket ¡library ¡

– Let’s ¡us ¡talk ¡to ¡Chrome ¡

¡

slide-63
SLIDE 63
slide-64
SLIDE 64
slide-65
SLIDE 65
slide-66
SLIDE 66
slide-67
SLIDE 67

Capturing ¡Start ¡Of ¡Network ¡Load ¡

slide-68
SLIDE 68

Capturing ¡Responses ¡

slide-69
SLIDE 69

Gotchas… ¡

  • 1. Chrome ¡gives ¡us ¡weird ¡Mmestamps… ¡

– NOT ¡a ¡UNIX ¡Mmestamp ¡ – Appears ¡to ¡be ¡“number ¡of ¡seconds ¡since ¡00:00:00 ¡today” ¡ – We ¡discovered ¡an ¡undocumented ¡field ¡that ¡appears ¡in ¡one ¡ message ¡that ¡gives ¡us ¡a ¡UNIX ¡Mmestamp ¡(very ¡weird) ¡

  • 2. Protocol ¡a ¡resource ¡is ¡loaded ¡with ¡is ¡not ¡exposed ¡

– Oh ¡wait, ¡it ¡is ¡exposed ¡via ¡parMally ¡documented ¡field… ¡

  • 3. We ¡might ¡receive ¡a ¡Network.loadEventFired ¡before ¡we ¡

receive ¡all ¡the ¡Network.responseReceived ¡events ¡

– This ¡one ¡took ¡awhile ¡to ¡figure ¡out… ¡ – SoluMon: ¡add ¡a ¡bit ¡of ¡a ¡delay ¡aeer ¡onload ¡to ¡keep ¡capturing ¡ – Ugly, ¡but ¡best ¡we ¡have ¡right ¡now. ¡

slide-70
SLIDE 70

Capturing ¡Video ¡

  • How ¡do ¡we ¡use ¡a ¡headless ¡browser ¡to ¡capture ¡

video?! ¡

  • Virtual ¡Frame ¡Buffer ¡(xvy) ¡

– Does ¡actually ¡render ¡stuff, ¡but ¡not ¡displayed ¡ anywhere ¡

  • Use ¡ffmpeg ¡to ¡record ¡the ¡rendering ¡

– We ¡tried ¡a ¡variety ¡of ¡methods, ¡e.g., ¡actually ¡copying ¡ the ¡framebuffer ¡file ¡ – ffmpeg ¡does ¡things ¡in ¡memory ¡ – “no” ¡latency ¡à ¡“guaranteed/stable” ¡framerate ¡ – We ¡encode ¡to ¡WebM ¡format ¡

slide-71
SLIDE 71

Storing ¡Things ¡

  • We ¡are ¡going ¡to ¡build ¡a ¡web ¡applicaMon… ¡
  • Need ¡to ¡access ¡the ¡data ¡to ¡show ¡to ¡users ¡
  • Could ¡use ¡flat ¡files ¡I ¡guess… ¡

– Would ¡suck… ¡Random ¡access ¡is ¡awful ¡here! ¡

¡

Database ¡ Time!!!!! ¡

slide-72
SLIDE 72

PostgreSQL ¡

  • “World’s ¡most ¡advanced ¡open ¡source ¡

RDBMS” ¡

  • We ¡have ¡a ¡lot ¡of ¡JSON ¡data ¡(HARs) ¡

– Doesn’t ¡map ¡well ¡to ¡typical ¡RDBMS ¡rows/columns ¡

  • Postgres ¡9.2+ ¡offers ¡us ¡a ¡JSON ¡column ¡type ¡

– 9.4+ ¡gives ¡us ¡JSONB ¡(a ¡binary ¡version) ¡ – Perfect ¡for ¡us! ¡

slide-73
SLIDE 73

eyeorg.net ¡-­‑ ¡Frontend ¡

  • Jekyll ¡

– Toolkit ¡for ¡building ¡staMc ¡websites ¡ – Gives ¡us ¡templaMng, ¡themes, ¡etc. ¡

  • Frontend ¡communicates ¡with ¡backend ¡via ¡

AJAX ¡

– Hits ¡a ¡web ¡API ¡that ¡returns ¡JSON ¡

slide-74
SLIDE 74

eyeorg.net ¡-­‑ ¡Backend ¡

  • Ruby ¡on ¡Rails ¡

– Major ¡funcMonality ¡

  • Grape ¡API ¡DSL ¡

– DSL ¡to ¡build ¡web ¡APIs ¡ – Frontend ¡will ¡access ¡ ¡ ¡ ¡

slide-75
SLIDE 75
slide-76
SLIDE 76

Pu{ng ¡it ¡all ¡together… ¡

slide-77
SLIDE 77

Demo ¡

slide-78
SLIDE 78

Preliminary ¡Results ¡

  • 43 ¡total ¡respondents ¡
  • Ma<eo ¡Demo’d ¡at ¡PAM ¡‘16 ¡

– We ¡got ¡~30 ¡or ¡so ¡respondents ¡ – Not ¡bad! ¡

  • Also ¡had ¡some ¡people ¡from ¡our ¡lab ¡use ¡it ¡

– Another ¡~10 ¡respondents ¡

slide-79
SLIDE 79

How ¡Were ¡Protocols ¡Distributed ¡A/B? ¡

30 60 90 120 a b

A or B count protocol

h1 h2

We ¡are ¡looking ¡for ¡a ¡50/50 ¡split ¡ We ¡got ¡~54/46 ¡split… ¡

¡

slide-80
SLIDE 80

Which ¡Was ¡Faster? ¡

30 60 90 H1 H2 No Difference

Which is faster? count

slide-81
SLIDE 81

How ¡Do ¡Humans ¡Compare ¡to ¡onload? ¡

0.00 0.25 0.50 0.75 1.00 110.753 1119.99 212.565 2719.19 2971.29 333.039 4125.29 436.877 624.916 767.361 954.173

  • nload delta (ms)

% "Correct"

slide-82
SLIDE 82

Lessons ¡Learned ¡So ¡Far ¡

  • 1. Some ¡people ¡viewed ¡it ¡as ¡a ¡compe%%on ¡

– “The ¡goal ¡is ¡to ¡pick ¡the ¡site ¡that ¡is ¡H2!” ¡ – This ¡wasn’t ¡what ¡we ¡expected… ¡

  • 2. Some ¡people ¡used ¡the ¡“slow ¡moMon” ¡feature ¡

– Kind ¡of ¡gives ¡them ¡“super ¡powers” ¡ – SMll ¡trying ¡to ¡decide ¡if ¡we ¡should ¡remove ¡this ¡

  • 3. Go<a ¡be ¡careful ¡with ¡how ¡we ¡load ¡things ¡

– Need ¡to ¡make ¡sure ¡that ¡we ¡sync ¡things ¡ – Possible ¡soluMon: ¡make ¡a ¡single ¡video ¡

slide-83
SLIDE 83

Next ¡Steps ¡

  • Deploy ¡to ¡crowdsourcing ¡pla~orm ¡

– Mechanical ¡Turk ¡ – Crowdflower ¡ – … ¡

  • Build ¡second ¡experiments ¡where ¡users ¡select ¡

when ¡a ¡page ¡has ¡“finished ¡loading” ¡

– Compare ¡human ¡derived ¡PLT ¡to ¡SpeedIndex ¡and ¡ “onload” ¡Mming ¡

slide-84
SLIDE 84

The ¡eyeorg.net ¡Vision ¡

  • A ¡distributed, ¡crowdsourced ¡pla~orm ¡for ¡

measuring ¡PLT ¡with ¡a ¡variety ¡of ¡metrics ¡

  • You ¡build ¡an ¡image ¡

– Has ¡your ¡custom ¡code ¡(e.g., ¡you ¡modified ¡chrome) ¡ – Has ¡some ¡configuraMon ¡

  • URLs ¡to ¡crawl ¡
  • How ¡to ¡choose ¡which ¡videos ¡to ¡display ¡
  • Whether ¡to ¡clear ¡cache ¡
  • Network ¡configuraMon ¡(delay, ¡TCP ¡stack, ¡etc...) ¡
  • … ¡
  • Push ¡image ¡to ¡eyeorg.net ¡à ¡get ¡results ¡
slide-85
SLIDE 85

Who ¡Did ¡This ¡Work? ¡

Check ¡out ¡“Is ¡The ¡Web ¡ HTTP/2 ¡Yet?” ¡from ¡ PAM ¡2016 ¡and ¡ isthewebh<p2yet.com ¡ Check ¡out ¡ eyeorg.net ¡and ¡ take ¡a ¡test! ¡

slide-86
SLIDE 86

Thank ¡You ¡For ¡Your ¡Time! ¡