doing horrible things with dns - web directions south

50
Doing Horrible Things to DNS (in the name of science) @sh1mmer Yahoo! Inc

Upload: tom-hughes-croucher

Post on 29-Nov-2014

4.513 views

Category:

Technology


0 download

DESCRIPTION

How can we make use of DNS to improve the performance of web sites? A simple introduction to DNS and a neat trick to improve web site performance using DNS.

TRANSCRIPT

Page 1: Doing Horrible Things with DNS - Web Directions South

Doing Horrible Things

to DNS(in the name of science)

@sh1mmer Yahoo! Inc

Page 2: Doing Horrible Things with DNS - Web Directions South

The basics of DNS

Page 3: Doing Horrible Things with DNS - Web Directions South
Page 4: Doing Horrible Things with DNS - Web Directions South
Page 5: Doing Horrible Things with DNS - Web Directions South
Page 6: Doing Horrible Things with DNS - Web Directions South
Page 7: Doing Horrible Things with DNS - Web Directions South
Page 8: Doing Horrible Things with DNS - Web Directions South
Page 9: Doing Horrible Things with DNS - Web Directions South
Page 10: Doing Horrible Things with DNS - Web Directions South

San Francisco - Mission Branch

Page 11: Doing Horrible Things with DNS - Web Directions South
Page 12: Doing Horrible Things with DNS - Web Directions South
Page 13: Doing Horrible Things with DNS - Web Directions South

San Francisco - Main Library

Page 14: Doing Horrible Things with DNS - Web Directions South
Page 15: Doing Horrible Things with DNS - Web Directions South
Page 16: Doing Horrible Things with DNS - Web Directions South

New York City - 5th & 42nd Branch

Page 17: Doing Horrible Things with DNS - Web Directions South
Page 18: Doing Horrible Things with DNS - Web Directions South
Page 19: Doing Horrible Things with DNS - Web Directions South

New York City - 5th & 42nd Branch

Page 20: Doing Horrible Things with DNS - Web Directions South
Page 21: Doing Horrible Things with DNS - Web Directions South

San Francisco - Main Library

NYC

Page 22: Doing Horrible Things with DNS - Web Directions South

San Francisco - Main Library

Page 23: Doing Horrible Things with DNS - Web Directions South
Page 24: Doing Horrible Things with DNS - Web Directions South

San Francisco - Mission Branch

NYC

SF

Page 25: Doing Horrible Things with DNS - Web Directions South

San Francisco - Mission Branch

Page 26: Doing Horrible Things with DNS - Web Directions South
Page 27: Doing Horrible Things with DNS - Web Directions South

NYC

SF

Mission

Page 28: Doing Horrible Things with DNS - Web Directions South
Page 29: Doing Horrible Things with DNS - Web Directions South

NYC

SF

Mission

Me

Page 30: Doing Horrible Things with DNS - Web Directions South
Page 31: Doing Horrible Things with DNS - Web Directions South

GTFO!It's 3am!

Page 32: Doing Horrible Things with DNS - Web Directions South

DNS for performance

Page 33: Doing Horrible Things with DNS - Web Directions South

Page Load Time vs. Bandwidth

Page 34: Doing Horrible Things with DNS - Web Directions South

Page Load Time vs. Round Trip Time

Page 35: Doing Horrible Things with DNS - Web Directions South

Trend Curves for Bandwidth vs. RTT

Page 36: Doing Horrible Things with DNS - Web Directions South

Serial HTTP loading - 1 domain

Page 37: Doing Horrible Things with DNS - Web Directions South

Parallel HTTP loading - 3 domains

Page 38: Doing Horrible Things with DNS - Web Directions South

So why not just use a loads of domains?

Page 39: Doing Horrible Things with DNS - Web Directions South

DNS Lookup

Page 40: Doing Horrible Things with DNS - Web Directions South

Ideal? 1 DNS query many parallel threads

Page 41: Doing Horrible Things with DNS - Web Directions South

Option 1: SPDY (by Google)

Page 42: Doing Horrible Things with DNS - Web Directions South

Good: Multi-thread TCP connections Bad: Only works on Chrome :(

Page 43: Doing Horrible Things with DNS - Web Directions South

Option 2: Do horrible things to DNS

Page 44: Doing Horrible Things with DNS - Web Directions South

Mucking about with C names

Page 45: Doing Horrible Things with DNS - Web Directions South

CNAMES are hosts which are aliases of other hosts

Page 46: Doing Horrible Things with DNS - Web Directions South

enki:~ $ dig yahoo.com

; <<>> DiG 9.4.3-P3 <<>> yahoo.com;; global options: printcmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32801;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 7, ADDITIONAL: 7

;; QUESTION SECTION:;yahoo.com. IN A

;; ANSWER SECTION:yahoo.com. 5935 IN A 69.147.125.65yahoo.com. 5935 IN A 72.30.2.43yahoo.com. 5935 IN A 98.137.149.56yahoo.com. 5935 IN A 209.191.122.70yahoo.com. 5935 IN A 67.195.160.76

...

;; Query time: 45 msec;; SERVER: 202.171.190.10#53(202.171.190.10);; WHEN: Wed Oct 13 17:23:39 2010;; MSG SIZE rcvd: 345

Query

Response

Page 47: Doing Horrible Things with DNS - Web Directions South

ajax1.hackerhouse.org. 1800 IN CNAME ajax2.hackerhouse.ajax2.hackerhouse.org. 1800 IN CNAME ajax3.hackerhouse.ajax3.hackerhouse.org. 1800 IN CNAME ajax4.hackerhouse.ajax4.hackerhouse.org. 1800 IN CNAME ajax.hackerhouse.ajax.hackerhouse.org. 1800 IN A 192.168.1.1ajax.hackerhouse.org. 1800 IN A 192.168.1.2ajax.hackerhouse.org. 1800 IN A 192.168.1.3ajax.hackerhouse.org. 1800 IN A 192.168.1.4ajax.hackerhouse.org. 1800 IN A 192.168.1.5

Page 48: Doing Horrible Things with DNS - Web Directions South

We now have 5 hostnames with 1 DNS query

Page 49: Doing Horrible Things with DNS - Web Directions South

5 hostnames x 6 request per host =

30 parallel requests

Page 50: Doing Horrible Things with DNS - Web Directions South

Doing Horrible Things

to DNS(in the name of science)

@sh1mmer Yahoo! Inc

Questions?