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 and HTTP2
Search
Andreas Bjärlestam
March 15, 2013
Technology
1
1.1k
SPDY and HTTP2
Andreas Bjärlestam
March 15, 2013
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 or maybe HTTP2.0
bjarlestam
4
61
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
ホワイトボードチャレンジ 説明&実行資料
ichimichi
0
120
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
1
120
モノレポ開発のエラー、誰が見る?Datadog で実現する適切なトリアージとエスカレーション
biwashi
6
790
サーバーレスアーキテクチャと生成AIの融合 / Serverless Meets Generative AI
_kensh
12
3.1k
ユーザーストーリーマッピングから始めるアジャイルチームと並走するQA / Starting QA with User Story Mapping
katawara
0
170
OpenID BizDay#17 KYC WG活動報告(法人) / 20250219-BizDay17-KYC-legalidentity
oidfj
0
140
表現を育てる
kiyou77
1
200
運用しているアプリケーションのDBのリプレイスをやってみた
miura55
1
490
Building Products in the LLM Era
ymatsuwitter
10
5k
白金鉱業Meetup Vol.17_あるデータサイエンティストのデータマネジメントとの向き合い方
brainpadpr
4
300
飲食店予約台帳を支えるインタラクティブ UI 設計と実装
siropaca
7
1.6k
データマネジメントのトレードオフに立ち向かう
ikkimiyazaki
3
300
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
182
22k
Faster Mobile Websites
deanohume
306
31k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.8k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
174
51k
Embracing the Ebb and Flow
colly
84
4.6k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Scaling GitHub
holman
459
140k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
How STYLIGHT went responsive
nonsquared
98
5.4k
Transcript
HTTP/2.0 [SPeeDY] Andreas Bjärlestam (@bjarlestam)! 2013-03-15!
Something strange happened last year
You know HTTP?
It has been replaced!* *at several of the biggest
sites on the web
And no-‐one has noJced
Why the hell would you want to replace HTTP?
HTTP is fantasJc it has totally changed the world
but…
HTTP is over 20 years old HTTP 1.1 is
12 years old
Webpages in 1999
None
Webpages in 2013
None
Mobile internet usage source: svenskarna och internet 2012
hRps://www.iis.se/docs/SOI2012.pdf
This is how more and more of us consume
the web…
OTen it feels a lot like…
People no longer have paJence to wait for slow
pages
$peed Performance == $$
Being slow has a strong negaJve impact on business
The cost of being slow increases over Jme and persists
Myth: If your site loads in under 4 seconds
you are ok Actually: The negaJve impact of being slow increases linearly!
Bounce rate increases linearly with page load Jme
Search engines rank faster sites higher
Bandwidth doesn’t maRer much anymore Latency does
Bandwidth Page Load Time 1Mbps 3Mbps
9Mbps Latency Page Load Time 240ms 120ms 20ms
Web pages March 2013 • www.facebook.com -‐ ca 170
hRp requests • www.bostonglobe.com -‐ ca 150 hRp requests • www.svtplay.se -‐ ca 50 hRp requests • www.aTonbladet.se -‐ ca 450 hRp requests source: hRp://hRparchive.org/
What does it look like over the network fetching
150 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 opJmizaJons CSS sprites base64 images in data-‐urls
CSS concatenaJon JavaScript concatenaJon
HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
HTTP/TCP 6 x HTTP connecJons
Domain sharding • www.bostonglobe.com -‐ 25 domains •
www.svtplay.se -‐ 9 domains • www.aTonbladet.se -‐ 42 domains source: hRp://www.webpagetest.org
What is the problem with this? Why not even
more connecJons?
We kind of abuse TCP when we open more
connecJons
2 connecJons per host recommended by HTTP 1.1 spec
6 connecJons in most browsers
and…
New TCP connecJons are slow
3 way handshake
On my macbook Ping 20ms ≈ 30ms to set
up a connecJon On my mobile (3G) Ping 300ms ≈ 450ms to set up a connecJon
HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
TCP Slow start HTTP/TCP
Window size 1 2 3 4 5 6 7
8 roundtrips TCP Slow start Packet loss
So… we need to uJlize our TCP connecJons beRer
Enter
Don’t we break the web if we replace HTTP?
Nope
The semanJcs of HTTP is kept
HTTP -‐> SPDY GET PUT POST
… HEADERS Use of URLs Use of TCP GET PUT POST … HEADERS Use of URLs Use of TCP
You can switch to SPDY with no changes to
your web applicaJon
Example…
Designed with speed as primary goal
1 TCP connecJon HTTP/TCP
HTTP/TCP But it will be on fire!
SPDY is mulJplexed
This is a typical HTTP session GET GET
GET 200 OK 200 OK 200 OK
MulJplexing GET 1 GET 2 GET 3
200 OK 2 200 OK 3 200 OK 1
Stream prioriJes
SPDY is binary
HTTP -‐> SPDY
Will be difficult to just fire up telnet and
hack away
Every decent site will be encrypted and gzipped
anyways
curl and wireshark will sJll be your friend
TLS/SSL is mandatory ✗
Simplest way to avoid problems with intermediaries
Headers are compressed
Server Push
Server Push
So is it worth it?
Many studies with slightly different results Most of
them indicate a significant speedup (10% – 60%) hRps://code.google.com/p/mod-‐spdy
SPDY could make your life easier No more hacky
opJmizaJons like CSS sprites, file concatenaJons, domain sharding etc
We need to unlearn some habits unshard
ImplementaJons • Apache mod_spdy • Nginx •
node_spdy • NeRy • JeRy • HAProxy • more…
Browsers • Chrome 6+ • Firefox 13+
• Opera 12.10+ • Amazon silk > 50% of browsers support SPDY
Google • Support SPDY on all their services (gmail
etc) • Most of their SSL traffic is over SPDY
Others • Akamai (Contendo) • Strangeloop •
F5 BIG-‐IP • TwiRer • Facebook • Wordpress • Amazon (kindle fire silkbrowser)
Amazon silk Silk Browser SPDY Gateway
The Internet SPDY HTTP Google has introduced a similar thing in chrome for android (beta version)
The spec • DraT spec, version 4 •
IETF has started to work on HTTP/2.0 • SPDY has been agreed to be the starJng point for HTTP/2.0
Roundup • Faster page loads than HTTP •
Backwards compaJble with HTTP • BeRer uJlizaJon of TCP • Secured by default • Binary + compressed
ARribuJons • hRp://en.wikipedia.org/wiki/ File:US_RoboJcs_56K_Modem_Front.JPG • hRps://www.iis.se/docs/SOI2012.pdf •
hRp://www.flickr.com/photos/howi/6366423373/ • hRp://www.flickr.com/photos/wwarby/5110037138/ • hRp://www.flickr.com/photos/alicetragedy/ 4977295298/ • hRp://www.flickr.com/photos/koltregaskes/ 624914973/in/photostream/
Backup slides
HTTP Pipelining • Not as effecJve as mulJplexing
• Hard to implement in browser • Opera is the only desktop browser that has a full implementaJon 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 MulJplexing GET GET GET 200 OK 200 OK 200 OK Synchronous