Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SPDY or maybe HTTP2.0
Search
Andreas Bjärlestam
February 23, 2012
Technology
4
59
SPDY or maybe HTTP2.0
An introduction to the SPDY protocol
Andreas Bjärlestam
February 23, 2012
Tweet
Share
More Decks by Andreas Bjärlestam
See All by Andreas Bjärlestam
Climate compensate with a pull request
bjarlestam
0
11
Agile performance testing
bjarlestam
0
99
SPDY and HTTP2
bjarlestam
1
1.1k
jquery mobile
bjarlestam
0
57
Devise - taking care of your users
bjarlestam
0
67
REST with JAX-RS
bjarlestam
1
88
REST
bjarlestam
2
150
Other Decks in Technology
See All in Technology
サーバー間 GraphQL と webmock-graphql の話 / server-to-server graphql and webmock-graphql
qsona
2
190
私が trocco を推す理由
__allllllllez__
1
240
本当のAWS基礎
toru_kubota
0
520
SIEMを用いて、セキュリティログ分析の可視化と分析を実現し、PDCAサイクルを回してみた
coconala_engineer
0
330
require(ESM)とECMAScript仕様
uhyo
3
760
ServiceNow Knowledge Learning Rise up
manarobot
0
210
LayerXにおけるLLMプロダクト開発の今までとこれから
layerx
PRO
1
360
検証を通して見えてきたTiDBの性能特性
lycorptech_jp
PRO
6
3.8k
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
5
390
APIファーストなプロダクトマネジメントの実践 〜SaaSus Platformでの例〜 / "Practicing API-First Product Management - An Example with SaaSus Platform
oztick139
0
110
GrafanaMeetup_AmazonManagedGrafanaのアクセス制御機能とマルチテナント環境下でのアクセス制御について
daitak
0
240
web-application-security
matsuihidetoshi
0
170
Featured
See All Featured
Designing the Hi-DPI Web
ddemaree
276
33k
It's Worth the Effort
3n
180
27k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
322
20k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Music & Morning Musume
bryan
41
5.6k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
274
13k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Unsuck your backbone
ammeep
663
57k
A Philosophy of Restraint
colly
197
16k
The Mythical Team-Month
searls
216
42k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
21
1.6k
Transcript
Or maybe HTTP2.0 [SPeeDY] Andreas Bjärlestam! 2012-02-23!
SPDY quick overview • An evolu?on of HTTP
• Developed by Google since 2009 • Proprietary • But open
Why the hell would you want to replace HTTP?
HTTP is fantas?c it has totally changed the world
but…
HTTP 1.1 is 12 years old
Webpages in 1999
None
Webpages in 2012
None
Mobile internet usage source: svenskarna och internet 2011
hPps://www.iis.se/docs/SOI2011.pdf
This is how more and more of us consume
the web…
OSen it feels a lot like…
People no longer have pa?ence to wait for slow
pages
Web pages February 2012 • www.facebook.com -‐ ca 100
hPp requests • www.bostonglobe.com -‐ ca 100 hPp requests • www.svtplay.se -‐ ca 90 hPp requests • www.aSonbladet.se -‐ ca 350 hPp requests source: hPp://hPparchive.org/
What does it look like over the network fetching
100 resources?
None
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 op?miza?ons CSS sprites base64 images in data-‐urls
CSS concatena?on JavaScript concatena?on
HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
HTTP/TCP 6 x HTTP connec?ons
What is the problem with this? Why not even
more?
TCP Conges?on control
Maximize throughput and Share network equally among
sessions
2 connec?ons per host recommended by HTTP 1.1 spec
6 connec?ons in most browsers
Domain sharding • www.bostonglobe.com -‐ 59 connec?ons •
www.svtplay.se -‐ 22 connec?ons • www.aSonbladet.se -‐ 118 connec?ons source: hPp://www.webpagetest.org
We kind of abuse TCP when we open more
connec?ons
and…
New TCP connec?ons are slow
3 way handshake
On my macbook Ping 20ms ≈ 30ms to set
up a connec?on On my mobile (3G) Ping 300ms ≈ 450ms to set up a connec?on
HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
TCP Slow start HTTP/TCP
It turns out that page load ?me for a moderately
complex site is almost no faster over 20mbits/ sec than over 2mbits/sec
So… we need to u?lize our TCP connec?ons bePer
Enter
Don’t we break the web if we replace HTTP?
Nope
The seman?cs of HTTP is kept
Spdy implements HPpApi
You can switch to SPDY with no changes to
your web applica?on
HTTP -‐> SPDY GET PUT POST
… HEADERS Use of URIs Use of TCP GET PUT POST … HEADERS Use of URIs Use of TCP
SPDY runs over TCP and will not require upgraded
network equipment
HTTP -‐> SPDY TCP/IP TLS/SSL HTTP
TCP/IP TLS/SSL SPDY HTTP
Designed with speed as primary goal
1 TCP connec?on HTTP/TCP
HTTP/TCP But it will be on fire!
SPDY is mul?plexed
This is a typical HTTP session GET GET
GET 200 OK 200 OK 200 OK
Mul?plexing GET 1 GET 2 GET 3
200 OK 2 200 OK 3 200 OK 1
Stream priori?es
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
Communica?on should be secure by default Users
should not have to care
None
Using SSL ensures that communica?on over exis?ng proxies
is not broken
..but you will not be able to use proxies
for caching etc
Headers are compressed
A SPDY conversa?on
How will the client know that it can use
SPDY towards a server?
NPN TLS Next Protocol Nego?a?on
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 important
to concatenate JavaScripts • Less important to concatenate CSS files • Less need for CSS sprites • No need for domain sharding
Should I add SPDY support to my servers on
Monday?
Probably not…
Implementa?ons • mod_spdy • Nginx – in roadmap
• node_spdy – with special openssl build etc • express_spdy – with node 0.7 etc • nePy • more…
Browsers • Chrome (since version 6) • Firefox
11 (turned off by default) • (Amazon silk)
CDNs • Strangeloop • Contendo
CDNs SPDY Gateway Your web server
Browser
Google • Support SPDY on most of their services
• 90% of their SSL traffic is over SPDY
Amazon silk Silk Browser SPDY Gateway
The Internet SPDY HTTP
The spec • DraS 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
Cri?cism • Going over SSL means no proxies
• More difficult to debug since it is binary and compressed
Alterna?ves
HTTP Pipelining • Not as effec?ve as mul?plexing
• Hard to implement in browser • Opera is the only desktop browser that has a full implementa?on enabled by default • Android, IOS5 and Opera mobile browsers do some amount of pipelining • Not used by most proxies
Pipelining GET 1 GET 2 GET 3
200 OK 1 200 OK 2 200 OK 3 GET 1 GET 2 GET 3 200 OK 2 200 OK 3 200 OK 1 Mul?plexing GET GET GET 200 OK 200 OK 200 OK Synchronous
Alterna?ve transport protocols • SCTP • BEEP
Roundup • ~ 50% Faster page loads than HTTP
• Backwards compa?ble with HTTP • BePer u?liza?on of TCP • Secured by default • Binary + compressed • Will likely be the base for HTTP2.0
APribu?ons • hPp://en.wikipedia.org/wiki/ File:US_Robo?cs_56K_Modem_Front.JPG • hPps://www.iis.se/docs/SOI2011.pdf •
hPp://www.flickr.com/photos/howi/6366423373/ • hPp://www.flickr.com/photos/wwarby/5110037138/ • hPp://www.flickr.com/photos/alicetragedy/ 4977295298/ • hPp://www.flickr.com/photos/koltregaskes/ 624914973/in/photostream/