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
61
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
30
Agile performance testing
bjarlestam
0
110
SPDY and HTTP2
bjarlestam
1
1.1k
jquery mobile
bjarlestam
0
69
Devise - taking care of your users
bjarlestam
0
71
REST with JAX-RS
bjarlestam
1
89
REST
bjarlestam
2
170
Other Decks in Technology
See All in Technology
Datadog APM におけるトレース収集の流れ及び Retention Filters のはなし / datadog-apm-trace-retention-filters
k6s4i53rx
0
330
次世代KYC活動報告 / 20250219-BizDay17-KYC-nextgen
oidfj
0
150
Developer Summit 2025 [14-D-1] Yuki Hattori
yuhattor
19
5.8k
Cloud Spanner 導入で実現した快適な開発と運用について
colopl
1
320
30分でわかる『アジャイルデータモデリング』
hanon52_
9
2.5k
Culture Deck
optfit
0
390
関東Kaggler会LT: 人狼コンペとLLM量子化について
nejumi
3
540
運用しているアプリケーションのDBのリプレイスをやってみた
miura55
1
490
OpenID BizDay#17 KYC WG活動報告(法人) / 20250219-BizDay17-KYC-legalidentity
oidfj
0
140
『AWS Distinguished Engineerに学ぶ リトライの技術』 #ARC403/Marc Brooker on Try again: The tools and techniques behind resilient systems
quiver
0
140
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
1
120
「海外登壇」という 選択肢を与えるために 〜Gophers EX
logica0419
0
640
Featured
See All Featured
Making Projects Easy
brettharned
116
6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
How to train your dragon (web standard)
notwaldorf
91
5.8k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Site-Speed That Sticks
csswizardry
3
370
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Designing for Performance
lara
604
68k
Adopting Sorbet at Scale
ufuk
74
9.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
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/