Upgrade to Pro — share decks privately, control downloads, hide ads and more …

You Ain't SPDY (Ruby Nation)

E33787005c363cd533977d48c690021c?s=47 chris
March 24, 2012

You Ain't SPDY (Ruby Nation)

You package your assets. You use CSS sprites. You serve up everything with gzip compression. You obsess over Yslow recommendations. But you are still not SPDY.

E33787005c363cd533977d48c690021c?s=128

chris

March 24, 2012
Tweet

Transcript

  1. You Ain't SPDY Chris Strom (@eee_c) Ruby Nation 2012-03-23

  2. None
  3. @backbonerecipes w/ Nick Gauthier @spdybook @dart4hipsters

  4. None
  5. Why SPDY? Deliver web pages and sophisticated web applications faster

    and more securely than is possible with vanilla HTTP
  6. SPDY is a replacement for HTTP

  7. SPDY is backwards compatible with HTTP

  8. SPDY still does HTTP-like things

  9. SPDY is optimized for page load times

  10. SPDY is optimized for page load times

  11. + You?

  12. SPDY

  13. SPDY is

  14. SPDY is the most

  15. SPDY is the most heavily

  16. SPDY is the most heavily tested

  17. SPDY is the most heavily tested protocol

  18. SPDY is the most heavily tested protocol ever.

  19. HTTP is antiquated

  20. HTTP is antiquated HTTP has not been updated in 12

    years
  21. HTTP is antiquated HTTP has not been updated in 12

    years HTTP is old
  22. HTTP is antiquated HTTP has not been updated in 12

    years HTTP is old HTTP is so old...
  23. None
  24. None
  25. None
  26. None
  27. None
  28. None
  29. None
  30. A Tale of Two Websites by httparchive.org

  31. None
  32. None
  33. None
  34. None
  35. None
  36. None
  37. None
  38. None
  39. None
  40. 38% of broadband users will close a site if it

    doesn't respond in 4 seconds
  41. 38% of broadband users will close a site if it

    doesn't respond in 4 seconds (precision is the key to any good statistic)
  42. = $$$

  43. None
  44. None
  45. That's freaking crazy

  46. Site #2...

  47. None
  48. None
  49. None
  50. None
  51. took 4.2 seconds to load 469kB of data over 75

    requests
  52. took 4.2 seconds to load 469kB of data over 75

    requests took ??? seconds to load 806kB of data over 83 requests
  53. took 4.2 seconds to load 469kB of data over 75

    requests took ??? seconds to load 806kB of data over 83 requests Average: 816kB of data over 83 requests
  54. How does Amazon do it?

  55. None
  56. None
  57. None
  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. None
  66. None
  67. But wait! There's more...

  68. None
  69. None
  70. None
  71. None
  72. None
  73. None
  74. None
  75. None
  76. None
  77. None
  78. None
  79. None
  80. None
  81. None
  82. Got all that?

  83. HTTP Optimizations

  84. !HTTP Optimizations

  85. !HTTP Optimizations HTTP Workarounds

  86. Bandwidth Will Save US!

  87. Bandwidth Will Save US! (won't it?)

  88. Bandwidth Doesn't Matter

  89. Bandwidth Doesn't Matter Beyond ~3mpbs, bandwidth makes no difference for

    page load times
  90. Bandwidth is for Downloading Ubuntu (not the Ubuntu download page)

  91. The Internet is built of tubes...

  92. Data travels One Way thru HTTP Tubes (kinda like a

    stargate)
  93. HTTP Tubes in Action

  94. How can the internet possibly work like that?

  95. None
  96. Problem Solved

  97. Problem Solved ?

  98. Brrr..! Connections Need to be Warmed thermometer indicating cold temperature

  99. Warm Connections == Higher Bandwidth

  100. None
  101. None
  102. None
  103. None
  104. None
  105. None
  106. Why Not Start the Tubes Warm? • Large congestion window

    (CWND) • CWND is initially 3 • 6 connections => we already have 18 initial CWND
  107. Why Not Start the Tubes Warm? • Large congestion window

    (CWND) • CWND is initially 3 • 6 connections => we already have 18 initial CWND • Already subverting TCP/IP • Is subverting further a good idea? • Especially given data loss rates that we already see?
  108. SPDY Tube...!

  109. SPDY Conversations...!

  110. SPDY!

  111. SPDY! It offers no new ideas!

  112. SPDY • Built on SSL • Binary • Don't send

    redundant header information • Aggressively compress stuff • Use a single(!) tube ◦ Only pay the warm-up penalty once ◦ Just like downloading an Ubuntu ISO!!!
  113. SPDY • SYN_STREAM • SYN_REPLY • RST_STREAM • SETTINGS •

    HEADERS • PING • GOAWAY • WINDOW_UPDATE • DATA
  114. SPDY • SYN_STREAM • SYN_REPLY • RST_STREAM • SETTINGS •

    HEADERS • PING • GOAWAY • WINDOW_UPDATE • DATA
  115. Current State of SPDY in Ruby In a word....

  116. Current State of SPDY in Ruby In a word.... Ugh.

  117. • An openssl-generated server key • The SPDY Gem •

    Edge-openssl for NPN (Next Protocol Negotiation) • Carson McDonald's NPN enabled fork of eventmachine* (in the tls-npn branch) — pull request #196 * https://github.com/carsonmcdonald/eventmachine
  118. None
  119. None
  120. None
  121. None
  122. None
  123. None
  124. None
  125. None
  126. None
  127. Real Browser Connections

  128. Packaging/Compressing Responses

  129. Real Browser Connections

  130. SPDY Server Push

  131. SPDY Server Push Pushes data directly into the browser cache

  132. Client Request (SYN_STREAM) +----------------------------------+ 80 02 00 01 |1| Version

    | 1 | +----------------------------------+ 02 00 00 38 | Flags (8) | Length (24 bits) | +----------------------------------+ 00 00 00 01 |X| Stream-ID (31bits) | +----------------------------------+ 00 00 00 00 |X|Associated-To-Stream-ID (31bits)| +----------------------------------+ 00 00 62 60 | Pri | Unused | | +------------------ | 64 60 06 05 | Name/value header block | 81 42 46 49 | ... | 49 41 b1 95 ....
  133. Server Response (SYN_REPLY) +----------------------------------+ 80 02 00 02 |1| Version

    | 2 | +----------------------------------+ 00 00 00 a4 | Flags (8) | Length (24 bits) | +----------------------------------+ 00 00 00 01 |X| Stream-ID (31bits) | +----------------------------------+ 00 00 78 bb | Unused | | df a2 51 b2 +---------------- | 62 e0 64 e0 | Name/value header block | 42 c4 10 03 | ... | 57 76 6a 6a
  134. Server Push (SYN_STREAM) +----------------------------------+ 80 02 00 01 |1| Version

    | 1 | +----------------------------------+ 02 00 00 51 | Flags (8) | Length (24 bits) | +----------------------------------+ 00 00 00 02 |X| Stream-ID (31bits) | +----------------------------------+ 00 00 00 01 |X|Associated-To-Stream-ID (31bits)| +----------------------------------+ 00 00 62 60 | Pri | Unused | | +------------------ | | Name/value header block | 23 c2 37 cc | ... | a0 40 52 c8 28 29 29 28
  135. SPDY Server Push

  136. SPDY Server Push

  137. SPDY Server Push

  138. SPDY Server Push

  139. SPDY Server Push

  140. Server Push #2 (SYN_STREAM) +----------------------------------+ 80 02 00 01 |1|

    Version | 1 | +----------------------------------+ 02 00 01 5b | Flags (8) | Length (24 bits) | +----------------------------------+ 00 00 00 04 |X| Stream-ID (31bits) | +----------------------------------+ 00 00 00 01 |X|Associated-To-Stream-ID (31bits)| +----------------------------------+ 00 00 62 60 | Pri | Unused | | +------------------ | | Name/value header block | 23 c2 37 cc | ... | a0 40 52 c8 28 29 29 28
  141. SPDY Server Push

  142. SPDY Server Push

  143. SPDY Server Push

  144. SPDY Server Push

  145. SPDY Server Push

  146. None
  147. None
  148. None
  149. None
  150. None
  151. SPDY Server Push

  152. None
  153. None
  154. None
  155. None
  156. took 11.4 seconds to load 806kB of data over 83

    requests
  157. Thanks! Chris Strom (@eee_c) spdybook.com Coupon: rn2012 (free!) See also

    Recipes with Backbone(.js) recipeswithbackbone.com Dart for Hipsters dart4hipsters.com