40
cd /pub cat beer > /dev/bluesmoon Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Station-wagons and electrons

Embed Size (px)

DESCRIPTION

Talk I did at Yahoo! Developer evening at Wallacespace: http://upcoming.yahoo.com/event/5741424/

Citation preview

Page 1: Station-wagons and electrons

cd /pubcat beer > /dev/bluesmoon

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 2: Station-wagons and electrons

Not stuck in a cloud of volcanic ash

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 3: Station-wagons and electrons

Didn’t get sidetracked on my way here

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 4: Station-wagons and electrons

Didn’t go on an extended vacation

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 5: Station-wagons and electrons

Almost not allowed in

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 6: Station-wagons and electrons

Philip Tellisgeekyahoo@bluesmoonhttp://bluesmoon.info/[email protected]

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 7: Station-wagons and electrons

Station wagons and Electrons

Philip Tellis / [email protected]

Yahoo! London Pub Night – May 27, 2010 – Wallacespace

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 8: Station-wagons and electrons

Never underestimate the bandwidth of a station wagonspeeding down the motorway

– Andrew S Tanenbaum?

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 9: Station-wagons and electrons

Should you fly a 747 or a 737?

A 747 seats 400+ passengersA 737 seats about 150Both take about the same time to fly from FRA to LHRA 747 takes longer to load and unload

The best selling aircraft to date is the 737

This analogy would have been much cooler if the Concorde still flew

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 10: Station-wagons and electrons

Bandwidth and Latency

How much data can you transfer at oncev/s

How quickly can you get your data across

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 11: Station-wagons and electrons

But bandwidth is easy

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 12: Station-wagons and electrons

Shannon’s Theorem

C = B × log2(1 +SN

)

C – Channel capacity in bpsB – Bandwidth in HzS – Signal strengthN – Noise strength – S/N measured in dB

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 13: Station-wagons and electrons

Bandwidth can be bought

Bandwidth has increased steadily over timeNetworks, hard drives, memory, CPU, system bus,everything.Bandwidth can be parallelised

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 14: Station-wagons and electrons

Diminishing returns

The benefits of increased bandwidth diminish as you get fatter

Ref: More bandwidth doesn’t matter (much) – Mike Belshe

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 15: Station-wagons and electrons

How fast is the internet?

YUI Blog measured bandwidth at 1Mbps and latency of 262ms

Ref: Analysing Bandwidth & Latency – YUI Blog

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 16: Station-wagons and electrons

Blink

The average human eye takes 300-400msto blink

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 17: Station-wagons and electrons

How fast is the internet?

Akamai measured average global bandwidth at 1.7Mbps

Ref: State of the Internet – Akamai

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 18: Station-wagons and electrons

ISPs

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 19: Station-wagons and electrons

UK ISPs

Keep in mind that the Internet latency from the UK to the US is 90-100ms

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 20: Station-wagons and electrons

Latency – not so easy to sell

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 21: Station-wagons and electrons

Speed Limits

3× 108 m/s – in vacuum2× 108 m/s – in fibre=⇒ 26.42ms × 2(roundtrip from BOS to LON)

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 22: Station-wagons and electrons

Round-trip

It should take a packet around 53ms to go from Boston toLondon and backIt actually takes around 90ms for a packet to go fromBoston to London and backThis is pretty good as far as approaching theoretical limitsgoes

Ref: It’s the latency, stupid – Stuart Cheshire

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 23: Station-wagons and electrons

Round-trip

It should take a packet around 53ms to go from Boston toLondon and backIt actually takes around 90ms for a packet to go fromBoston to London and backThis is pretty good as far as approaching theoretical limitsgoes

Ref: It’s the latency, stupid – Stuart Cheshire

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 24: Station-wagons and electrons

But then again...

Never underestimate the data-transfer capabilities of aGalaxy class starship travelling at Warp 9.875 andfitted with a computer that sounds like Majel Barett

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 25: Station-wagons and electrons

Latency isn’t sexy

When was the last time you saw a TV commercial mentionlatency?

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 26: Station-wagons and electrons

ISPs

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 27: Station-wagons and electrons

UK ISPs

Keep in mind that the Internet latency from the UK to the US is 90-100ms

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 28: Station-wagons and electrons

Latency v/s Bandwidth

Improving latency tends to improve perceived bandwidthImproving bandwidth utilisation can potentially worsenlatencyLarger/complex packets take more time to assemble

This is the difference between a 737 and a 747

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 29: Station-wagons and electrons

Getting around latency problems

Don’t add latency – It’s bad enough without us adding to itCaching – Bring the data closer to where it’s neededParallelise – Reduce the number of serial roundtripsPredict – Get data before it’s needed

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 30: Station-wagons and electrons

If you can, stuff everything into one callHave a look at search.yahoo.com load up in firebug

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 31: Station-wagons and electrons

Parallelise where possible

Downloading a script blocks page load, so do it in thebackground insteadBrowsers will download 4-8 resources from a host inparallel, take advantage of that

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 32: Station-wagons and electrons

Predict what’s next and fetch it

If you know what the user will do next, pre-fetch itYahoo! Search page pre-loads sprites and Javascript forthe results pageLog analysis can tell you which pages are most popular,and pre-fetch those

Ref: Preload CSS & JS without execution – Stoyan Stefanov

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 33: Station-wagons and electrons

Measure your user’s bandwidth & latency

Javascript code to measure your user’s bandwidth & latencyhttp://bluesmoon.info/perf-tests/bw/bw-test-1.3.ziphttp://github.com/bluesmoon/netperf-js

It’s what we used on the YUIBlog test

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 34: Station-wagons and electrons

Useful tools for performance analysis

YSlow – Firefox/Firebug plugin from Yahoo!PageSpeed – Firefox/Firebug plugin from GooglePageTest – Web page testing toolShowSlow – Automated YSlow runs against your URLFiddler – Web debugging Proxy

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 35: Station-wagons and electrons

Further reading

developer.yahoo.com/performance – Yahoo!code.google.com/speed/page-speed/docs/rules_intro.html– Googleslideshare.net/stoyan/the-business-of-performance –Stoyan Stefanovstevesouders.com/blog/ – Steve Soudersphpied.com – Stoyan Stefanov

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 36: Station-wagons and electrons

Stay tuned...

Coming this summer...to an interweb near you

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 37: Station-wagons and electrons

Stay tuned...

BOOMERANG2010 06 24

STARRING: JAVASCRIPT, APACHE, YAHOOSCRIPT: BLUESMOON, PRODUCTION: TOM CROUCHER, CHOREOGRAPHY: CROCKFORD

http://developer.yahoo.net/blog

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 38: Station-wagons and electrons

Photo credits

flickr.com/photos/sully_aka__wstera2/4538240734/flickr.com/photos/gertcha/4168724489/flickr.com/photos/30720140@N08/4290289036/flickr.com/photos/dharmasphere/253277654/flickr.com/photos/gi/117771718/flickr.com/photos/siennaisalive/4436708323/flickr.com/photos/vlastula/300102949/flickr.com/photos/electrichamster/3160580687/flickr.com/photos/burnblue/308441464/

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 39: Station-wagons and electrons

Contact me

Philip Tellisyahoogeek@bluesmoonhttp://bluesmoon.info/slideshare.net/[email protected]

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons

Page 40: Station-wagons and electrons

Thank you

Yahoo! London Pub Night – May 27, 2010 – Wallacespace Station wagons and Electrons