Slide 1

Slide 1 text

SPDY://WHAT? PROTOCOLS, TRANSPORTS, AND SPEED Created by / Michael Hamrah @mhamrah

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

WHAT PROBLEM ARE WE TRYING TO SOLVE? Web sites are slow*

Slide 4

Slide 4 text

HOW DO WE WANT TO SOLVE IT? We dont!

Slide 5

Slide 5 text

IS HTTP THAT BAD? V E R B / s o m e / p a t h / t o / c o n t e n t H T T P / 1 . 1 H o s t : w w w . s o m e h o s t . c o m A c c e p t : t e x t / h t m l A c c e p t - L a n g u a g e : e n - u s A c c e p t - E n c o d i n g : g z i p , d e f l a t e U s e r - A g e n t : M o z i l l a / 5 . 0 ( M a c i n t o s h ; I n t e l M a c O S X 1 0 _ 8 _ 3 ) A p p l e W e b K i t / 5 3 7 . 3 1 ( C o n n e c t i o n : K e e p - A l i v e C o n t e n t - L e n g t h : 2 0 M a y b e s o m e b o d y h e r e

Slide 6

Slide 6 text

A QUICK DETOUR FOR TCP WHAT GOES INTO A CONNECTION? Round trip: Syn/Syn-Ack/Ack (LATENCY!) NYC to SFC: ~2530mi, RTT in vacuum: 27ms, RTT in fiber: 41.04ms Slow-Start/Window Scaling (Diminishing returns on bandwidth)

Slide 7

Slide 7 text

HOW DO WE SOLVE THIS NOW? Http 1.1: Keep-alive default (option for 1.0 Http 1.1: Pipelining (not good enough, maybe not even used) Browsers: 6-8 max concurrent connections per server Think of 1mb of data split 1, 10, 100 ways cache-control Minimize connections (sprites, minification, domain sharding)

Slide 8

Slide 8 text

WASN'T THIS TALK ON SPDY? SPDY embraces HTTP, don't reinvent wheel. It's not WebSockets, different problem.

Slide 9

Slide 9 text

MULTIPLEXING Spdy uses one persistent SSL connection and multiplexes requests. True duplex; no waiting. Better window scaling Frames replace individual request/response (Control Frames/Data Frames)

Slide 10

Slide 10 text

COMPRESSED HEADERS More important than you may realize! Cookies, repetitive headers, etc.

Slide 11

Slide 11 text

CONTENT PRIORITIZATION Have some control between browser/server

Slide 12

Slide 12 text

SERVER PUSH/SERVER HINT Server can send or suggest new resources without client having to parse html

Slide 13

Slide 13 text

SPDY: TRY IT! TLS connection uses NPN (Next Protocol Negotitation to upgrade to SPDY) HTTP semantics do not change Support for node.js (node-spdy), NGINX, Apache HTTP 2.0 will be largerly based on SPDY http://dev.chromium.org/spdy

Slide 14

Slide 14 text

LINKS Spdy Whitepaper TCP Tuning Content Negotiation with HAProxy Best Practices Mozilla learning lab