SlideShare uma empresa Scribd logo
1 de 83
Andreas Bjärlestam   2012-02-23
SPDY quick overview
• An evolution of HTTP
• Developed by Google since 2009
• Openly available spec
Why the hell would you want to
        replace HTTP?
HTTP is fantastic

it has totally changed the world
but…
HTTP is over 20 years old


HTTP 1.1 is 12 years old
Webpages in 1999
Webpages in 2012
Mobile internet usage




source: svenskarnaoch internet 2011 https://www.iis.se/docs/SOI2011.pdf
This is how more and more of us
        consume the web…
Often it feels a lot like…
People no longer have patience to
       wait for slow pages
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 requests




                              source: http://httparchive.org/
What does it look like over the
network fetching 100 resources?
Can you spot the problem?
Its all synchronous
How come an advanced page like
  facebook.com loads in under 4
seconds when its all synchronous?
Hacky optimizations

        CSS sprites
base64 images in data-urls
    CSS concatenation
 JavaScript concatenation
6 x HTTP connections
       HTTP/TCP


       HTTP/TCP


       HTTP/TCP


       HTTP/TCP


       HTTP/TCP


       HTTP/TCP
What is the problem with this? Why
          not even more?
Wasted resources
TCP Congestion control
2 connections per host recommended
          by HTTP 1.1 spec


  6 connections in most browsers
Domain sharding

• www.bostonglobe.com - 59 connections
• www.svtplay.se - 22 connections
• www.aftonbladet.se - 118 connections




                          source: http://www.webpagetest.org
We kind of abuse TCP
when we open more
    connections
and…
New TCP connections are slow
3 way handshake
On my macbook
 Ping 20ms ≈ 30ms to set up a
         connection


      On my mobile (3G)
Ping 300ms ≈ 450ms to set up a
         connection
TCP Slow start
    HTTP/TCP


    HTTP/TCP


    HTTP/TCP

    HTTP/TCP

    HTTP/TCP

    HTTP/TCP
It turns out that page load time for a moderately
   complex site is almost no faster over
   20mbits/sec than over 2mbits/sec
So… we need to utilize our TCP
     connections better
Enter
Don’t we break the web if we replace
              HTTP?
Nope
The semantics of HTTP is kept
or in simpler words…

SPDY implements the HTTP API
HTTP -> SPDY

   GET                        GET
   PUT                        PUT
              HEADERS                    HEADERS
   POST                       POST
    …                          …




Use of URLs   Use of TCP   Use of URLs   Use of TCP
You can switch to SPDY with no
changes to your web application
SPDY runs over TCP and will not
  require upgraded network
          equipment
HTTP -> SPDY

                    HTTP


 HTTP               SPDY


TLS/SSL            TLS/SSL


TCP/IP             TCP/IP
Designed with
   speed as
 primary goal
1 TCP connection



     HTTP/TCP
But it will be on fire!



        HTTP/TCP
SPDY is multiplexed
This is a typical HTTP session
             GET

            200 OK

             GET

            200 OK

             GET

            200 OK
Multiplexing
    GET 1
    GET 2
    GET 3


   200 OK 2
   200 OK 3
   200 OK 1
Stream priorities
SPDY is binary
Will be difficult to just fire up telnet
           and hack away
Every decent site will be encrypted
      and gzipped anyways
TLS/SSL is mandatory
Communication should be
        secure by default


Users should not
  have to care
Using SSL ensures that
communication over existing
   proxies is not broken
..but you will not be able to
 use proxies for caching etc
Headers are compressed
How will the client know that it can
   use SPDY towards a server?
NPN

TLS Next Protocol Negotiation
Server Push
Server Push
So is it worth it?
Google tested 25 of the
   “top 100” sites
Average speedup

  39% - 55%
SPDY could make your life easier

Less need for hacky optimizations
       like CSS sprites, file
concatenations, domain sharding
                etc
Should I add SPDY support to my
     servers on Monday?
Probably not…
Implementations
•   Apache mod_spdy
•   Nginx – in roadmap
•   node_spdy – requires node.js 0.7
•   netty
•   more…
Example…
Browsers
• Chrome (since version 6)
• Firefox 11 (turned off by default)
• (Amazon silk)
CDNs
• Strangeloop
• Contendo
CDNs

             SPDY     Your web
Browser
            Gateway    server
Google
• Support SPDY on most of their services
• 90% of their SSL traffic is over SPDY
Amazon silk


  Silk    SPDY      SPDY     HTTP     The
Browser            Gateway          Internet
The spec
• Draft spec, version 3
• Plan is to submit it to IETF as input to HTTP2.0
• IETF HTTPbis WG chair recently proposed to
  start work on HTTP2.0
Alternatives
HTTP Pipelining
• Not as effective as multiplexing
• Hard to implement in browser
• Opera is the only desktop browser that has a
  full implementation enabled by default
• Android, IOS5 and Opera mobile browsers do
  some amount of pipelining
• Not used by most proxies
Synchronous   Pipelining     Multiplexing

    GET            GET 1          GET 1
                   GET 2          GET 2
   200 OK
                   GET 3          GET 3
    GET
   200 OK         200 OK 1       200 OK 2

    GET           200 OK 2       200 OK 3
                  200 OK 3       200 OK 1
   200 OK
Alternative transport protocols
• SCTP
• BEEP
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
Attributions
• http://en.wikipedia.org/wiki/File:US_Robotics_56K_M
  odem_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/497729529
  8/
• http://www.flickr.com/photos/koltregaskes/624914973
  /in/photostream/

Mais conteúdo relacionado

Mais procurados

Http/2 - What's it all about?
Http/2  - What's it all about?Http/2  - What's it all about?
Http/2 - What's it all about?
Andy Davies
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
timbc
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
Roland M
 

Mais procurados (20)

O'Reilly Fluent Conference: HTTP/1.1 vs. HTTP/2
O'Reilly Fluent Conference: HTTP/1.1 vs. HTTP/2O'Reilly Fluent Conference: HTTP/1.1 vs. HTTP/2
O'Reilly Fluent Conference: HTTP/1.1 vs. HTTP/2
 
SPDY and HTTP/2
SPDY and HTTP/2SPDY and HTTP/2
SPDY and HTTP/2
 
HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and Why
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
 
HTTP/2 standard for video streaming
HTTP/2 standard for video streamingHTTP/2 standard for video streaming
HTTP/2 standard for video streaming
 
HTTP/2 Update - FOSDEM 2016
HTTP/2 Update - FOSDEM 2016HTTP/2 Update - FOSDEM 2016
HTTP/2 Update - FOSDEM 2016
 
HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1
 
Http/2 - What's it all about?
Http/2  - What's it all about?Http/2  - What's it all about?
Http/2 - What's it all about?
 
HTTP 2.0 Why, How and When
HTTP 2.0 Why, How and WhenHTTP 2.0 Why, How and When
HTTP 2.0 Why, How and When
 
An introduction to HTTP/2 for SEOs
An introduction to HTTP/2 for SEOsAn introduction to HTTP/2 for SEOs
An introduction to HTTP/2 for SEOs
 
HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战
 
HTTP - The Protocol of Our Lives
HTTP - The Protocol of Our LivesHTTP - The Protocol of Our Lives
HTTP - The Protocol of Our Lives
 
I got 99 problems, but ReST ain't one
I got 99 problems, but ReST ain't oneI got 99 problems, but ReST ain't one
I got 99 problems, but ReST ain't one
 
The Case for HTTP/2
The Case for HTTP/2The Case for HTTP/2
The Case for HTTP/2
 
HTTP/2 : why upgrading the web? - apidays Paris
HTTP/2 : why upgrading the web? - apidays ParisHTTP/2 : why upgrading the web? - apidays Paris
HTTP/2 : why upgrading the web? - apidays Paris
 
Hacking Web Performance 2019
Hacking Web Performance 2019Hacking Web Performance 2019
Hacking Web Performance 2019
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
 
Http/2
Http/2Http/2
Http/2
 

Semelhante a SPDY - or maybe HTTP2.0

Semelhante a SPDY - or maybe HTTP2.0 (20)

SPDY
SPDY SPDY
SPDY
 
SPDY
SPDYSPDY
SPDY
 
Spdy
SpdySpdy
Spdy
 
Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocols
 
Maximizing SPDY and SSL Performance (June 2014)
Maximizing SPDY and SSL Performance (June 2014)Maximizing SPDY and SSL Performance (June 2014)
Maximizing SPDY and SSL Performance (June 2014)
 
HTTP/2 and SAP Fiori
HTTP/2 and SAP FioriHTTP/2 and SAP Fiori
HTTP/2 and SAP Fiori
 
spdy
spdyspdy
spdy
 
SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012SPDY - http reloaded - WebTechConference 2012
SPDY - http reloaded - WebTechConference 2012
 
SPDY and What to Consider for HTTP/2.0
SPDY and What to Consider for HTTP/2.0SPDY and What to Consider for HTTP/2.0
SPDY and What to Consider for HTTP/2.0
 
From Fast To SPDY
From Fast To SPDYFrom Fast To SPDY
From Fast To SPDY
 
Improving performance by changing the rules from fast to SPDY
Improving performance by changing the rules   from fast to SPDYImproving performance by changing the rules   from fast to SPDY
Improving performance by changing the rules from fast to SPDY
 
SPDY Talk
SPDY TalkSPDY Talk
SPDY Talk
 
SPDY
SPDYSPDY
SPDY
 
HTTP/3 for everyone
HTTP/3 for everyoneHTTP/3 for everyone
HTTP/3 for everyone
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
 
What is SPDY
What is SPDYWhat is SPDY
What is SPDY
 
SPDY.pdf
SPDY.pdfSPDY.pdf
SPDY.pdf
 
HTTP/2 and a Faster Web
HTTP/2 and a Faster WebHTTP/2 and a Faster Web
HTTP/2 and a Faster Web
 
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
 
I want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUICI want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUIC
 

Mais de Andreas Bjärlestam (6)

Climate compensate with a pull request (2).pdf
Climate compensate with a pull request (2).pdfClimate compensate with a pull request (2).pdf
Climate compensate with a pull request (2).pdf
 
Agile performance testing
Agile performance testingAgile performance testing
Agile performance testing
 
Mobile web with jQuery Mobile
Mobile web with jQuery MobileMobile web with jQuery Mobile
Mobile web with jQuery Mobile
 
Devise
DeviseDevise
Devise
 
Introduction to JAX-RS
Introduction to JAX-RSIntroduction to JAX-RS
Introduction to JAX-RS
 
REST
RESTREST
REST
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

SPDY - or maybe HTTP2.0