SlideShare a Scribd company logo
HTTP at your local BigCo:How the internet sausage gets made	Peter Griess@pgriess
Goals and non-goalsBasics of TCP/IP, DNS and HTTP and how they work together; pitfalls and optimizationsA 1,000 foot view of scaling out HTTP infrastructureAll manner of load balancing / traffic shapingLiving on the edgeNot: how to make a fast application (database access, rendering performance, etc)
Background: DNSMap hostnames to IP(s)www.facebook.com 69.171.229.12, 69.171.228.40Resolution processRecursion (and what does the DNS server see?)CachingLatencies: on-host, cached in LAN, cached at ISP, miss
Background: TCPStateful protocolNegotiated by a synchronous 3-way handshake:2xRTT before first byte is sent!e.g. USA => South America ~250ms RTTSeamless failover is hard (but not impossible)Load balancing must be aware of flows
Background: HTTPLayered on top of TCP/TLSHas some useful bitsCompressionConnection re-usePipeliningCachingKind of sucksHeaders on all requests/responsesCompression on bodies onlyPipelining has to be disabled most of the timePipelining suffers from head-of-line blocking
mycutekittens.tv68.193.17.4Big bad internetHTTP
Problem?
ProblemAvailabilityServer goes down (kernel panic?)Network goes down (cable cut?)Datacenter goes down (EC2?)OverloadShed load (good, can be transparent)Get infinitely slow (not good)
mycutekittens.tv: multi-serverBig bad internet???
We have optionsDNS load balancingIP load balancingHTTP load balancing
DNS load balancingmycutekittens.tv resolves to IPs: A, B, C, DAdd new IPs to scale outRemove IPs when hosts go downBenefitsDon’t need extra hardware to do load balancingCan span datacentersDNS servers are cheap / fastDrawbacksHotspots due to cachingHotspots due to ordering in result listHotspots due to resolver sizeTTL / flexibility trade-off
mycutekittens.tv: DNSBig bad internetDNS ServerDNS68.193.17.468.193.17.568.193.17.6
IP load balancing (1)mycutekittens.tv resolves to 1 public IP owned by an IP load balancerAdd new backend hosts w/ private IPs to scale outLoad balancer health-checks hosts actively or passively to avoid dead hostsScheduling policies vs. failoverDSR
IP load balancing (2)BenefitsOnly 1 public IP (high DNS TTL)Backend network capacity/membership transparent to the internetCheap-ishFailover is possible, not insanely difficultDrawbacksCan’t do what you can with HTTP
mycutekittens.tv: IP10.0.0.1Big bad internet10.0.0.2GW68.193.17.410.0.0.3LB
HTTP load balancing (1)mycutekittens.tv resolves to 1 public IP owned by an HTTP load balancerLargely same as IP load balancingTerminates TCP connections (sees all bytes)Can make routing decisions based on HTTPCan autonomously serve requests (caching, access control, etc)Examples:Send requests for /foo/* to pool A401 requests without cookie Q
HTTP load balancing (2)BenefitsLargely the same as IPMore flexible rulesCan terminate TLS (security+, cost+)DrawbacksNo DSRFailover difficultNot as performant as IP
mycutekittens.tv: HTTP10.0.0.1Big bad internet10.0.0.268.193.17.4LBHTTP(S)10.0.0.3
mycutekittens.tv: MOAREventually a single LB is going to be a problemNot enough capacityAvailabilityTurtles all the day way downLB of LBs!DNS load balancing between datacenters…
HTTPS: myths and realityToo computationally expensiveOnly a few percent (imperialviolet.org); is your webserver actually CPU bound? doubt itSSL acceleration cards, GPUs, etcToo much latencyHandshaking is 5-7xRTTSession resumeFalse startSnap startCaching breaks
My latency is huge in JapanRTT to USA is (or any single DC) can be hugeRe-use connections (connection: keep-alive)Send work in parallel (pipelining)Use compression (content-encoding)Lots of tricks for static resources (bundling, CDNs, caching, etc)Pre-fetch data
Let’s get crazy: SPDYDon’t limit yourself to HTTP; use a different protocolSPDY developed by Google, supported by Chrome, google.com (and soon facebook.com)Connection re-use w/o head-of-line blockingHeaders always compressedAlways SSL (but breaks caching)
Let’s get crazy: TCP terminationSynchronous RTTs: the silent killerOpening new TCP connections is very costlyRun proxies close to users and proxy traffic back to core using optimized protocolLow RTT to proxyDo SPDY-like tricks between edge + corePotentially faster network to core than public internetAdvertise these proxies via DNSGeo-targettingAS-adjacencyAkamai CDN does this, sort of
Let’s get crazy: DNS anycastRemember how DNS resolutions were slow?DNS servers could be far away from a userAdvertise multiple network routes for the same DNS IP, let the IP stack pick the closest one

More Related Content

PDF
HTTP/2 Update - FOSDEM 2016
PDF
What HTTP/2.0 Will Do For You
PDF
HTTP2 & HPACK #pyfes 2013-11-30
PDF
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
PDF
HTTP2:新的机遇与挑战
PDF
PDF
Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...
PDF
Ftp server linux
HTTP/2 Update - FOSDEM 2016
What HTTP/2.0 Will Do For You
HTTP2 & HPACK #pyfes 2013-11-30
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP2:新的机遇与挑战
Tempesta FW - Framework и Firewall для WAF и DDoS mitigation, Александр Крижа...
Ftp server linux

What's hot (20)

PPTX
Introducing HTTP/2
PPTX
HTTP/2 Introduction
PDF
So that was HTTP/2, what's next?
ODT
Load Balancing with HAproxy
PPTX
Web server
PDF
HTTP/2: What no one is telling you
PDF
Http2 right now
PPTX
HTTP/2 for Developers
PPTX
Introduction to HTTP/2
PDF
HTTP2 is Here!
PDF
HTTP/2 standard for video streaming
PDF
HTTP 2.0 – What do I need to know?
PPTX
ODP
ChinaNetCloud Training - HAProxy Intro
PPT
Netkitmig
PPT
Web Server Load Balancer
PPTX
Choosing A Proxy Server - Apachecon 2014
PDF
6 technical-dns-workshop-day3
ODP
HAProxy scale out using open source
PDF
SPDY and HTTP/2
Introducing HTTP/2
HTTP/2 Introduction
So that was HTTP/2, what's next?
Load Balancing with HAproxy
Web server
HTTP/2: What no one is telling you
Http2 right now
HTTP/2 for Developers
Introduction to HTTP/2
HTTP2 is Here!
HTTP/2 standard for video streaming
HTTP 2.0 – What do I need to know?
ChinaNetCloud Training - HAProxy Intro
Netkitmig
Web Server Load Balancer
Choosing A Proxy Server - Apachecon 2014
6 technical-dns-workshop-day3
HAProxy scale out using open source
SPDY and HTTP/2
Ad

Viewers also liked (7)

PDF
A póker titkai mike caro
PPT
Itay
PPTX
Introwebinargettingdiversebuttsthedwcgroup7 11-dc-edits-2
PPTX
Slidesharetest
PPT
The New Black Test
PPTX
donotusethisversion-dc-edits
PPT
Augmented Reality
A póker titkai mike caro
Itay
Introwebinargettingdiversebuttsthedwcgroup7 11-dc-edits-2
Slidesharetest
The New Black Test
donotusethisversion-dc-edits
Augmented Reality
Ad

Similar to HTTP at your local BigCo (20)

PPTX
Next generation web protocols
PDF
HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612
PDF
Computer network (10)
PPT
Data center disaster recovery.ppt
PPTX
PPTX
HTML5, HTTP2, and You 1.1
ODP
Scaling Streaming - Concepts, Research, Goals
PDF
From Fast To SPDY
PDF
Improving performance by changing the rules from fast to SPDY
PDF
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
PPT
Serverless (Distributed computing)
PDF
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
PPT
My other computer_is_a_datacentre
PDF
HBaseCon 2015: HBase at Scale in an Online and High-Demand Environment
PDF
Http2 in practice
PPTX
Stephan Ewen - Experiences running Flink at Very Large Scale
PPT
Network and distributed systems
ODP
MNPHP Scalable Architecture 101 - Feb 3 2011
PPT
Knowledge share about scalable application architecture
PPTX
Next generation web protocols
HTTP/2 turns 3 years old // Web Performance Meetup wao.io 20180612
Computer network (10)
Data center disaster recovery.ppt
HTML5, HTTP2, and You 1.1
Scaling Streaming - Concepts, Research, Goals
From Fast To SPDY
Improving performance by changing the rules from fast to SPDY
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Serverless (Distributed computing)
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
My other computer_is_a_datacentre
HBaseCon 2015: HBase at Scale in an Online and High-Demand Environment
Http2 in practice
Stephan Ewen - Experiences running Flink at Very Large Scale
Network and distributed systems
MNPHP Scalable Architecture 101 - Feb 3 2011
Knowledge share about scalable application architecture

Recently uploaded (20)

PPTX
Lecture 3b C Library xnxjxjxjxkx_ ESP32.pptx
PDF
Caterpillar CAT 312B L EXCAVATOR (2KW00001-UP) Operation and Maintenance Manu...
PPTX
capstoneoooooooooooooooooooooooooooooooooo
PPT
Your score increases as you pick a category, fill out a long description and ...
PPT
ACCOMPLISHMENT REPOERTS AND FILE OF GRADE 12 2021.ppt
PDF
Volvo EC290C NL EC290CNL Excavator Service Repair Manual Instant Download.pdf
PPTX
Type of Sentence & SaaaaaaaaaadddVA.pptx
PDF
Volvo EC20C Excavator Service maintenance schedules.pdf
PPT
Mettal aloys and it's application and theri composition
PDF
Renesas R-Car_Cockpit_overview210214-Gen4.pdf
PPTX
UNIT-2(B) Organisavtional Appraisal.pptx
PDF
higher edu open stores 12.5.24 (1).pdf forreal
DOCX
lp of food hygiene.docxvvvvvvvvvvvvvvvvvvvvvvv
PDF
Volvo EC290C NL EC290CNL engine Manual.pdf
PPTX
TOEFL ITP Grammar_ Clausessssssssssssssssss.pptx
PDF
Todays Technician Automotive Heating & Air Conditioning Classroom Manual and ...
PDF
MANDIBLE (1).pdffawffffffffffffffffffffffffffffffffffffffffff
PPTX
Fire Fighting Unit IV industrial safety.pptx
PDF
computer system to create, modify, analyse or optimize an engineering design.
PDF
Volvo EC20C Excavator Step-by-step Maintenance Instructions pdf
Lecture 3b C Library xnxjxjxjxkx_ ESP32.pptx
Caterpillar CAT 312B L EXCAVATOR (2KW00001-UP) Operation and Maintenance Manu...
capstoneoooooooooooooooooooooooooooooooooo
Your score increases as you pick a category, fill out a long description and ...
ACCOMPLISHMENT REPOERTS AND FILE OF GRADE 12 2021.ppt
Volvo EC290C NL EC290CNL Excavator Service Repair Manual Instant Download.pdf
Type of Sentence & SaaaaaaaaaadddVA.pptx
Volvo EC20C Excavator Service maintenance schedules.pdf
Mettal aloys and it's application and theri composition
Renesas R-Car_Cockpit_overview210214-Gen4.pdf
UNIT-2(B) Organisavtional Appraisal.pptx
higher edu open stores 12.5.24 (1).pdf forreal
lp of food hygiene.docxvvvvvvvvvvvvvvvvvvvvvvv
Volvo EC290C NL EC290CNL engine Manual.pdf
TOEFL ITP Grammar_ Clausessssssssssssssssss.pptx
Todays Technician Automotive Heating & Air Conditioning Classroom Manual and ...
MANDIBLE (1).pdffawffffffffffffffffffffffffffffffffffffffffff
Fire Fighting Unit IV industrial safety.pptx
computer system to create, modify, analyse or optimize an engineering design.
Volvo EC20C Excavator Step-by-step Maintenance Instructions pdf

HTTP at your local BigCo

  • 1. HTTP at your local BigCo:How the internet sausage gets made Peter Griess@pgriess
  • 2. Goals and non-goalsBasics of TCP/IP, DNS and HTTP and how they work together; pitfalls and optimizationsA 1,000 foot view of scaling out HTTP infrastructureAll manner of load balancing / traffic shapingLiving on the edgeNot: how to make a fast application (database access, rendering performance, etc)
  • 3. Background: DNSMap hostnames to IP(s)www.facebook.com 69.171.229.12, 69.171.228.40Resolution processRecursion (and what does the DNS server see?)CachingLatencies: on-host, cached in LAN, cached at ISP, miss
  • 4. Background: TCPStateful protocolNegotiated by a synchronous 3-way handshake:2xRTT before first byte is sent!e.g. USA => South America ~250ms RTTSeamless failover is hard (but not impossible)Load balancing must be aware of flows
  • 5. Background: HTTPLayered on top of TCP/TLSHas some useful bitsCompressionConnection re-usePipeliningCachingKind of sucksHeaders on all requests/responsesCompression on bodies onlyPipelining has to be disabled most of the timePipelining suffers from head-of-line blocking
  • 8. ProblemAvailabilityServer goes down (kernel panic?)Network goes down (cable cut?)Datacenter goes down (EC2?)OverloadShed load (good, can be transparent)Get infinitely slow (not good)
  • 10. We have optionsDNS load balancingIP load balancingHTTP load balancing
  • 11. DNS load balancingmycutekittens.tv resolves to IPs: A, B, C, DAdd new IPs to scale outRemove IPs when hosts go downBenefitsDon’t need extra hardware to do load balancingCan span datacentersDNS servers are cheap / fastDrawbacksHotspots due to cachingHotspots due to ordering in result listHotspots due to resolver sizeTTL / flexibility trade-off
  • 12. mycutekittens.tv: DNSBig bad internetDNS ServerDNS68.193.17.468.193.17.568.193.17.6
  • 13. IP load balancing (1)mycutekittens.tv resolves to 1 public IP owned by an IP load balancerAdd new backend hosts w/ private IPs to scale outLoad balancer health-checks hosts actively or passively to avoid dead hostsScheduling policies vs. failoverDSR
  • 14. IP load balancing (2)BenefitsOnly 1 public IP (high DNS TTL)Backend network capacity/membership transparent to the internetCheap-ishFailover is possible, not insanely difficultDrawbacksCan’t do what you can with HTTP
  • 15. mycutekittens.tv: IP10.0.0.1Big bad internet10.0.0.2GW68.193.17.410.0.0.3LB
  • 16. HTTP load balancing (1)mycutekittens.tv resolves to 1 public IP owned by an HTTP load balancerLargely same as IP load balancingTerminates TCP connections (sees all bytes)Can make routing decisions based on HTTPCan autonomously serve requests (caching, access control, etc)Examples:Send requests for /foo/* to pool A401 requests without cookie Q
  • 17. HTTP load balancing (2)BenefitsLargely the same as IPMore flexible rulesCan terminate TLS (security+, cost+)DrawbacksNo DSRFailover difficultNot as performant as IP
  • 18. mycutekittens.tv: HTTP10.0.0.1Big bad internet10.0.0.268.193.17.4LBHTTP(S)10.0.0.3
  • 19. mycutekittens.tv: MOAREventually a single LB is going to be a problemNot enough capacityAvailabilityTurtles all the day way downLB of LBs!DNS load balancing between datacenters…
  • 20. HTTPS: myths and realityToo computationally expensiveOnly a few percent (imperialviolet.org); is your webserver actually CPU bound? doubt itSSL acceleration cards, GPUs, etcToo much latencyHandshaking is 5-7xRTTSession resumeFalse startSnap startCaching breaks
  • 21. My latency is huge in JapanRTT to USA is (or any single DC) can be hugeRe-use connections (connection: keep-alive)Send work in parallel (pipelining)Use compression (content-encoding)Lots of tricks for static resources (bundling, CDNs, caching, etc)Pre-fetch data
  • 22. Let’s get crazy: SPDYDon’t limit yourself to HTTP; use a different protocolSPDY developed by Google, supported by Chrome, google.com (and soon facebook.com)Connection re-use w/o head-of-line blockingHeaders always compressedAlways SSL (but breaks caching)
  • 23. Let’s get crazy: TCP terminationSynchronous RTTs: the silent killerOpening new TCP connections is very costlyRun proxies close to users and proxy traffic back to core using optimized protocolLow RTT to proxyDo SPDY-like tricks between edge + corePotentially faster network to core than public internetAdvertise these proxies via DNSGeo-targettingAS-adjacencyAkamai CDN does this, sort of
  • 24. Let’s get crazy: DNS anycastRemember how DNS resolutions were slow?DNS servers could be far away from a userAdvertise multiple network routes for the same DNS IP, let the IP stack pick the closest one