Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
SPDY at LinkedIn 
Omer Shapira
Agenda 
What to expect before beers 
 LinkedIn 
 Bandwidth vs. Latency 
 Challenges with HTTP 
 What is SPDY 
 How Li...
Speed matters 
Who we are and what we do 
 Social network for business 
 Founded in 2002 
 300M+ users 
 200 countries...
Let’s talk about speed 
What’s speed, anyway? 
 We measure vehicle speed in m/s 
 How do we measure the Internet 
speed?...
Let’s talk about bandwidth 
One bazzillion MBps… 
 Bandwidth is analogous to 
number of seats in a plane 
 Adding bandwi...
Let’s talk about latency 
Latency: time it takes for the server to receive and process 
request for a page object 
 Short...
Important latency limits 
No one will advertise latency 
 100ms – user perceives as instantaneous. 
 1s – is about the u...
Reality check 
Signal latency in vacuum and fiber 
Route Distance 
(km) 
Time in 
vacuum (ms) 
Time in fiber 
(ms) 
TCP ha...
More about network latency 
Not all latencies are the same
In reality 
Not all latencies are the same
Fast Internet 
Short latencies, high bandwidth, opportunities 
 Low latency 
 High bandwidth 
 … 
 PROFIT!
Let’s talk about HTTP 
Long latencies, low bandwidth, lots of client time 
 Mimics interactions between a person and a ne...
Hyper TEXT transfer protocol 
In reality we mostly transfer images
Challenges with HTTP 
The protocol is getting obsolete
Challenges with HTTP 
5 requests in flight, the rest wait… 
Once all threads are used, 
the browser blocks the next reques...
Challenges with HTTP 
Congestion Control
Challenges with HTTP 
Data from server 
 Under HTTP/1.1, browser has to parse the page to get more URLs 
 This includes ...
Challenges with HTTP 
Headers are never compressed 
 Headers are transmitted with every request 
 But some of the header...
SPDY – a new beginning 
Foundations for HTTP/2
Overview of SPDY 
Drop in replacement, transparent for webdevs and SWEs 
 Starts with NPN negotiation (optionally as HTTP...
Overview of SPDY 
Multiplexing instead of thread pools 
 Single connection is maintained between browser and server 
 Co...
Overview of SPDY 
Based on SSL/TLS 
 Negotiated over SSL (NPN/ALPN) or as HTTP upgrade 
 Transport layer security (alway...
Overview of SPDY 
Server push 
 Server can speculatively push resources to client before base page 
has been parsed 
 Re...
Overview of SPDY 
Header elimination and compression 
 Explicit headers are 
eliminated 
 Headers are further 
compresse...
So what? 
Putting SPDY to work at LinkedIn 
25
Anatomy of a page 
One base page and tons of static content 
26 
Base page 
Static 
Content
LinkedIn network stack 
Or rather non-planar graph 
27
CDNs 
Blazing fast, ubiquitous and not flexible 
 Distribute the content 
around the globe 
 Make the web pretty fast 
b...
There is a CDN edge near you
Can we beat CDNs locally? 
Let’s use science to experiment!
Comparing SPDY with CDN - 
results 
Results 
 Profile page is better across 
the board 
 Homepage is better for 
regions...
LinkedIn network stack 
Overly simplified
LinkedIn network stack 
Pushing the CDN aside
Static content vs. base pages – 
round 2
Combining SPDY with CDNs 
Deploy SPDY stacks around the globe
Bottom line 
SPDY makes web faster; so do CDNs 
 Modern CDNs do pretty good job accelerating HTTP 
 SPDY accelerates web...
Questions
We are hiring
Upcoming SlideShare
Loading in …5
×

Внедрение протокола SPDY в социальной сети LinkedIn, Omer Shapira (LinkedIn)

1,212 views

Published on

Доклад Олега Шапиро (Omer Shapira) на HighLoad++ 2014.

Published in: Internet
  • Be the first to comment

  • Be the first to like this

Внедрение протокола SPDY в социальной сети LinkedIn, Omer Shapira (LinkedIn)

  1. 1. SPDY at LinkedIn Omer Shapira
  2. 2. Agenda What to expect before beers  LinkedIn  Bandwidth vs. Latency  Challenges with HTTP  What is SPDY  How LinkedIn network stack looks today  How we are adopting SPDY
  3. 3. Speed matters Who we are and what we do  Social network for business  Founded in 2002  300M+ users  200 countries  Users first
  4. 4. Let’s talk about speed What’s speed, anyway?  We measure vehicle speed in m/s  How do we measure the Internet speed?  Cars vs. trains as analogy  Bandwidth vs. latency
  5. 5. Let’s talk about bandwidth One bazzillion MBps…  Bandwidth is analogous to number of seats in a plane  Adding bandwidth is expensive – but simple  Typically sold as “speed”  Matters for streaming  Bandwidth does not matter that much for business applications
  6. 6. Let’s talk about latency Latency: time it takes for the server to receive and process request for a page object  Shorten the pipe  Or move faster  Speed of light is a hard limit  Decreasing latency is hard and sometimes impossible
  7. 7. Important latency limits No one will advertise latency  100ms – user perceives as instantaneous.  1s – is about the upper limit of human flow of thought. User loses the feeling direct feedback.  10s – upper limit of attention. Feedback is important, and the chance of context switch is high.  Source: Nielsen Norman Group
  8. 8. Reality check Signal latency in vacuum and fiber Route Distance (km) Time in vacuum (ms) Time in fiber (ms) TCP handshake in fiber (ms) NYC to SF 4148 14 21 63 NYC to London 5585 19 28 84 NYC to Sydney 15993 53 80 240
  9. 9. More about network latency Not all latencies are the same
  10. 10. In reality Not all latencies are the same
  11. 11. Fast Internet Short latencies, high bandwidth, opportunities  Low latency  High bandwidth  …  PROFIT!
  12. 12. Let’s talk about HTTP Long latencies, low bandwidth, lots of client time  Mimics interactions between a person and a newspaper – Reading a page takes time. – Transferring text is easy – Single browser window  On a Sunday morning, with a cup of coffee
  13. 13. Hyper TEXT transfer protocol In reality we mostly transfer images
  14. 14. Challenges with HTTP The protocol is getting obsolete
  15. 15. Challenges with HTTP 5 requests in flight, the rest wait… Once all threads are used, the browser blocks the next request…
  16. 16. Challenges with HTTP Congestion Control
  17. 17. Challenges with HTTP Data from server  Under HTTP/1.1, browser has to parse the page to get more URLs  This includes executing JS in <head> section  Extra latency
  18. 18. Challenges with HTTP Headers are never compressed  Headers are transmitted with every request  But some of the headers need to be only transferred once – Accepts-Encoding  Headers are never compressed Server sent 914 bytes to transfer 57 bytes of response. This is 15x overhead
  19. 19. SPDY – a new beginning Foundations for HTTP/2
  20. 20. Overview of SPDY Drop in replacement, transparent for webdevs and SWEs  Starts with NPN negotiation (optionally as HTTP)  If both server and browser support SPDY, they switch to SPDY
  21. 21. Overview of SPDY Multiplexing instead of thread pools  Single connection is maintained between browser and server  Congestion window grows, increasing utilization of the network  Unlimited resources in flight – browser is not blocked
  22. 22. Overview of SPDY Based on SSL/TLS  Negotiated over SSL (NPN/ALPN) or as HTTP upgrade  Transport layer security (always in SPDY, optional in HTTP/2.0)  Compression (including headers) 22
  23. 23. Overview of SPDY Server push  Server can speculatively push resources to client before base page has been parsed  Resources can be reused between pages through the browser cache. 23
  24. 24. Overview of SPDY Header elimination and compression  Explicit headers are eliminated  Headers are further compressed 24
  25. 25. So what? Putting SPDY to work at LinkedIn 25
  26. 26. Anatomy of a page One base page and tons of static content 26 Base page Static Content
  27. 27. LinkedIn network stack Or rather non-planar graph 27
  28. 28. CDNs Blazing fast, ubiquitous and not flexible  Distribute the content around the globe  Make the web pretty fast by shortening the pipes
  29. 29. There is a CDN edge near you
  30. 30. Can we beat CDNs locally? Let’s use science to experiment!
  31. 31. Comparing SPDY with CDN - results Results  Profile page is better across the board  Homepage is better for regions closer to ECH Benefits of SPDY increased with for regions close to the PoP
  32. 32. LinkedIn network stack Overly simplified
  33. 33. LinkedIn network stack Pushing the CDN aside
  34. 34. Static content vs. base pages – round 2
  35. 35. Combining SPDY with CDNs Deploy SPDY stacks around the globe
  36. 36. Bottom line SPDY makes web faster; so do CDNs  Modern CDNs do pretty good job accelerating HTTP  SPDY accelerates web content delivery further  Serving static content through SPDY accelerates LinkedIn page  In the long run, CDNs will support SPDY (HTTP/2.0). This will make the web faster for everybody.
  37. 37. Questions
  38. 38. We are hiring

×