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
28
Agile performance testing
bjarlestam
0
110
SPDY and HTTP2
bjarlestam
1
1.1k
jquery mobile
bjarlestam
0
68
Devise - taking care of your users
bjarlestam
0
69
REST with JAX-RS
bjarlestam
1
88
REST
bjarlestam
2
160
Other Decks in Technology
See All in Technology
Intuneお役立ちツールのご紹介
sukank
3
750
3次元点群データ「VIRTUAL SHIZUOKA』のオープンデータ化による恩恵と協働の未来/FOSS4G Japan 2024
kazz24s
0
130
AI長期記憶システム構築のための LLMマルチエージェントの取り組み / Awarefy-LLM-Multi-Agent
iktakahiro
2
350
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
130
AWS⼊社という選択肢、⾒えていますか
iwamot
2
1.1k
AIチャットボット開発への生成AI活用
ryomrt
0
140
データ活用促進のためのデータ分析基盤の進化
takumakouno
2
450
mikroBus HAT を用いた簡易ベアメタル開発
tarotene
0
270
Datadog RUM を用いた UX 指標の監視・顧客対応への活用
imamura_ko_0314
0
110
GraphRAGを用いたLLMによるパーソナライズド推薦の生成
naveed92
0
190
ジョブマッチングサービスにおける相互推薦システムの応用事例と課題
hakubishin3
3
620
SREの前に
nwiizo
11
2.7k
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
Documentation Writing (for coders)
carmenintech
65
4.4k
Building Applications with DynamoDB
mza
90
6.1k
Embracing the Ebb and Flow
colly
84
4.5k
Bash Introduction
62gerente
608
210k
Designing for Performance
lara
604
68k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Optimizing for Happiness
mojombo
376
69k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
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/