spdy - or maybe http2.0

Download SPDY - or maybe HTTP2.0

Post on 15-May-2015




0 download

Embed Size (px)


The SPDY protocol has been developed by Google since 2009. It is intended as an evolution of HTTP with better performance and network utilization.


  • 1. Andreas Bjrlestam 2012-02-23

2. SPDY quick overview An evolution of HTTP Developed by Google since 2009 Openly available spec 3. Why the hell would you want toreplace HTTP? 4. HTTP is fantasticit has totally changed the world 5. but 6. HTTP is over 20 years oldHTTP 1.1 is 12 years old 7. Webpages in 1999 8. Webpages in 2012 9. Mobile internet usagesource: svenskarnaoch internet 2011 https://www.iis.se/docs/SOI2011.pdf 10. This is how more and more of usconsume the web 11. Often it feels a lot like 12. People no longer have patience to wait for slow pages 13. Web pages February 2012 www.facebook.com - ca 100 http requests www.bostonglobe.com - ca 100 http requests www.svtplay.se - ca 90 http requests www.aftonbladet.se - ca 350 http requestssource: http://httparchive.org/ 14. What does it look like over thenetwork fetching 100 resources? 15. Can you spot the problem? 16. Its all synchronous 17. How come an advanced page likefacebook.com loads in under 4seconds when its all synchronous? 18. Hacky optimizationsCSS spritesbase64 images in data-urlsCSS concatenation JavaScript concatenation 19. 6 x HTTP connections HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP 20. What is the problem with this? Whynot even more? 21. Wasted resources 22. TCP Congestion control 23. 2 connections per host recommendedby HTTP 1.1 spec6 connections in most browsers 24. Domain sharding www.bostonglobe.com - 59 connections www.svtplay.se - 22 connections www.aftonbladet.se - 118 connectionssource: http://www.webpagetest.org 25. We kind of abuse TCPwhen we open moreconnections 26. and 27. New TCP connections are slow 28. 3 way handshake 29. On my macbook Ping 20ms 30ms to set up a connectionOn my mobile (3G)Ping 300ms 450ms to set up a connection 30. TCP Slow startHTTP/TCPHTTP/TCPHTTP/TCPHTTP/TCPHTTP/TCPHTTP/TCP 31. It turns out that page load time for a moderately complex site is almost no faster over 20mbits/sec than over 2mbits/sec 32. So we need to utilize our TCP connections better 33. Enter 34. Dont we break the web if we replaceHTTP? 35. Nope 36. The semantics of HTTP is kept 37. or in simpler wordsSPDY implements the HTTP API 38. HTTP -> SPDY GETGET PUTPUTHEADERSHEADERS POST POSTUse of URLs Use of TCP Use of URLs Use of TCP 39. You can switch to SPDY with nochanges to your web application 40. SPDY runs over TCP and will notrequire upgraded networkequipment 41. HTTP -> SPDYHTTP HTTP SPDYTLS/SSLTLS/SSLTCP/IP TCP/IP 42. Designed with speed as primary goal 43. 1 TCP connection HTTP/TCP 44. But it will be on fire!HTTP/TCP 45. SPDY is multiplexed 46. This is a typical HTTP session GET200 OK GET200 OK GET200 OK 47. MultiplexingGET 1GET 2GET 3 200 OK 2 200 OK 3 200 OK 1 48. Stream priorities 49. SPDY is binary 50. Will be difficult to just fire up telnet and hack away 51. Every decent site will be encryptedand gzipped anyways 52. TLS/SSL is mandatory 53. Communication should besecure by defaultUsers should nothave to care 54. Using SSL ensures thatcommunication over existing proxies is not broken 55. ..but you will not be able to use proxies for caching etc 56. Headers are compressed 57. How will the client know that it can use SPDY towards a server? 58. NPNTLS Next Protocol Negotiation 59. Server Push 60. Server Push 61. So is it worth it? 62. Google tested 25 of the top 100 sites 63. Average speedup39% - 55% 64. SPDY could make your life easierLess need for hacky optimizations like CSS sprites, fileconcatenations, domain shardingetc 65. Should I add SPDY support to my servers on Monday? 66. Probably not 67. Implementations Apache mod_spdy Nginx in roadmap node_spdy requires node.js 0.7 netty more 68. Example 69. Browsers Chrome (since version 6) Firefox 11 (turned off by default) (Amazon silk) 70. CDNs Strangeloop Contendo 71. CDNs SPDY Your webBrowserGatewayserver 72. Google Support SPDY on most of their services 90% of their SSL traffic is over SPDY 73. Amazon silkSilkSPDYSPDY HTTP TheBrowserGatewayInternet 74. The spec Draft spec, version 3 Plan is to submit it to IETF as input to HTTP2.0 IETF HTTPbis WG chair recently proposed tostart work on HTTP2.0 75. Alternatives 76. HTTP Pipelining Not as effective as multiplexing Hard to implement in browser Opera is the only desktop browser that has afull implementation enabled by default Android, IOS5 and Opera mobile browsers dosome amount of pipelining Not used by most proxies 77. Synchronous Pipelining MultiplexingGETGET 1GET 1 GET 2GET 2 200 OK GET 3GET 3GET 200 OK 200 OK 1 200 OK 2GET 200 OK 2 200 OK 3200 OK 3 200 OK 1 200 OK 78. Alternative transport protocols SCTP BEEP 79. Roundup ~ 50% Faster page loads than HTTP Backwards compatible with HTTP Better utilization of TCP Secured by default Binary + compressed Will likely be the base for HTTP2.0 80. Attributions http://en.wikipedia.org/wiki/File:US_Robotics_56K_Modem_Front.JPG https://www.iis.se/docs/SOI2011.pdf http://www.flickr.com/photos/howi/6366423373/ http://www.flickr.com/photos/wwarby/5110037138/ http://www.flickr.com/photos/alicetragedy/4977295298/ http://www.flickr.com/photos/koltregaskes/624914973/in/photostream/