Station-wagons and electrons

Post on 18-May-2015

2,708 views 0 download

Tags:

description

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

transcript

cd /pubcat beer > /dev/bluesmoon

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

Not stuck in a cloud of volcanic ash

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

Didn’t get sidetracked on my way here

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

Didn’t go on an extended vacation

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

Almost not allowed in

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

Philip Tellisgeekyahoo@bluesmoonhttp://bluesmoon.info/philip@bluesmoon.info

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

Station wagons and Electrons

Philip Tellis / philip@bluesmoon.info

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

Yahoo! London Pub Night – May 27, 2010 – Wallacespace 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

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

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

But bandwidth is easy

Yahoo! London Pub Night – May 27, 2010 – Wallacespace 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

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

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

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

Blink

The average human eye takes 300-400msto blink

Yahoo! London Pub Night – May 27, 2010 – Wallacespace 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

ISPs

Yahoo! London Pub Night – May 27, 2010 – Wallacespace 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

Latency – not so easy to sell

Yahoo! London Pub Night – May 27, 2010 – Wallacespace 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

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

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

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

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

ISPs

Yahoo! London Pub Night – May 27, 2010 – Wallacespace 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

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

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

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

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

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

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

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

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

Stay tuned...

Coming this summer...to an interweb near you

Yahoo! London Pub Night – May 27, 2010 – Wallacespace 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

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

Contact me

Philip Tellisyahoogeek@bluesmoonhttp://bluesmoon.info/slideshare.net/bluesmoonphilip@bluesmoon.info

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

Thank you

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