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. 2.
  2. 4.
  3. 5.

    Why SPDY? Deliver web pages and sophisticated web applications faster

    and more securely than is possible with vanilla HTTP
  4. 11.
  5. 12.
  6. 13.
  7. 22.

    HTTP is antiquated HTTP has not been updated in 12

    years HTTP is old HTTP is so old...
  8. 23.
  9. 24.
  10. 25.
  11. 26.
  12. 27.
  13. 28.
  14. 29.
  15. 31.
  16. 32.
  17. 33.
  18. 34.
  19. 35.
  20. 36.
  21. 37.
  22. 38.
  23. 39.
  24. 40.

    38% of broadband users will close a site if it

    doesn't respond in 4 seconds
  25. 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)
  26. 42.
  27. 43.
  28. 44.
  29. 47.
  30. 48.
  31. 49.
  32. 50.
  33. 52.

    took 4.2 seconds to load 469kB of data over 75

    requests took ??? seconds to load 806kB of data over 83 requests
  34. 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
  35. 55.
  36. 56.
  37. 57.
  38. 58.
  39. 59.
  40. 60.
  41. 61.
  42. 62.
  43. 63.
  44. 64.
  45. 65.
  46. 66.
  47. 68.
  48. 69.
  49. 70.
  50. 71.
  51. 72.
  52. 73.
  53. 74.
  54. 75.
  55. 76.
  56. 77.
  57. 78.
  58. 79.
  59. 80.
  60. 81.
  61. 95.
  62. 100.
  63. 101.
  64. 102.
  65. 103.
  66. 104.
  67. 105.
  68. 106.

    Why Not Start the Tubes Warm? • Large congestion window

    (CWND) • CWND is initially 3 • 6 connections => we already have 18 initial CWND
  69. 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?
  70. 110.
  71. 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!!!
  72. 113.

    SPDY • SYN_STREAM • SYN_REPLY • RST_STREAM • SETTINGS •

    HEADERS • PING • GOAWAY • WINDOW_UPDATE • DATA
  73. 114.

    SPDY • SYN_STREAM • SYN_REPLY • RST_STREAM • SETTINGS •

    HEADERS • PING • GOAWAY • WINDOW_UPDATE • DATA
  74. 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
  75. 118.
  76. 119.
  77. 120.
  78. 121.
  79. 122.
  80. 123.
  81. 124.
  82. 125.
  83. 126.
  84. 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 ....
  85. 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
  86. 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
  87. 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
  88. 146.
  89. 147.
  90. 148.
  91. 149.
  92. 150.
  93. 152.
  94. 153.
  95. 154.
  96. 155.
  97. 157.

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

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