CONTENT DELIVERY NETWORKS

motherlamentationInternet και Εφαρμογές Web

7 Δεκ 2013 (πριν από 3 χρόνια και 6 μήνες)

71 εμφανίσεις

CONTENT DELIVERY
NETWORKS
Simple, fast and cheap
Murray Woodman
murray.woodmanpreviousnext.com.au

Great functionality
Great content
http://www.flickr.com/photos/pagedooley/3121844717/
Great delivery?
http://www.flickr.com/photos/pheanixphotos/5835605434/
PAGES ARE GROWING
http://www.strangeloopnetworks.com
/
PERFORMANCE GOLDEN
RULE
80-90% of the end-user response time is spent
downloading all the components
in the page:
images, stylesheets, scripts, Flash, etc.
http://developer.yahoo.com/performance/rules.html
OVERVIEW
1.
The basics
2.
Advantages
3.
Under the covers
4.
CDN selection
5.
Demo
1. THE BASICS
CONTENT DELIVERY
NETWORK
A collection of web servers distributed across
multiple locations
to
deliver content more
efficiently
to users. The server selected for
delivering content to a specific user is typically
based on a measure of
network proximity
.
http://developer.yahoo.com/performance/rules.html
WITHOUT A CDN
www
you
WITH A CDN
www
you
1. ADVANTAGES
Scalability, UX & business
http://www.flickr.com/photos/sunova_surfboards/5444811750
1. BETTER SCALABILITY

Avoid spikes

Reduced load on server

Cost effective
2. BETTER USER EXPERIENCE
Three ways in which users
perceive delay:

0.1 second
- instantaneous

1 second
- interacting freely
10 seconds
- unfocused
Robert B Miller (1968)
http://www.flickr.com/photos/rsdio/3642119413
3. BETTER BUSINESS

Higher loyalty

Lower rates of abandonment

Higher satisfaction
http://dev.gomez.com/wp-content/downloads/Aberdeen_WebApps.pdf
USERS EXPECT IT
Two seconds is the new threshold
in terms of an average
online shopper’s
expectation
for a web page to load and 40
percent of shoppers will wait no more than
three seconds
before abandoning
a retail or travel site.
http://www.akamai.com/html/about/press/releases/2009/press_091409.html
2. UNDER THE COVERS
A little technical nitty gritty
http://www.flickr.com/photos/sunova_surfboards/5685329481/
DDU2012 DEMO SITE

http://ddu2012.cruncht.net

(westcoast USA)

cdn-small.ddu2012.cruncht.net

(cname pointing to the CDN)

wac.3B12.edgecastcdn.net

(CDN)
DNS MAGIC
me@
westcoast
:~$ dig
cdn-small.ddu2012.cruncht.net
cdn-small.ddu2012.cruncht.net. IN CNAME wac.3B12.edgecastcdn.net.
wac.3B12.edgecastcdn.net. !IN CNAME gs1.wac.edgecastcdn.net.
gs1.wac.edgecastcdn.net. !IN A!
72.21.91.19

me@
sydney
:~$ dig
cdn-small.ddu2012.cruncht.net
cdn-small.ddu2012.cruncht.net. IN CNAME wac.3B12.edgecastcdn.net.
wac.3B12.edgecastcdn.net. !IN CNAME gs1.wac.edgecastcdn.net.
gs1.wac.edgecastcdn.net. !IN A!
68.232.44.219
PING
me@
sydney
:~$ ping
ddu2012.cruncht.net
PING ddu2012.cruncht.net (173.255.234.217)
time=
234
ms
me@
sydney
:~$ ping
cdn-small.ddu2012.cruncht.net
PING gs1.wac.edgecastcdn.net (68.232.44.219)
time=
14.6
ms
me@
westcoast
:~$ ping
cdn-small.ddu2012.cruncht.net
PING gs1.wac.edgecastcdn.net (72.21.91.19)
time=
8.57
ms
TWO TYPES OF CDN

Origin Pull
CDN edge requests a file from the origin server when its local
cache is empty.

Push
The origin server pushes files to the CDN when needed. The
CDN distributes files to the edges.
PUSH VS PULL

Origin pull easier to set up.

Push gives you more flexibility with file processing.

Push needs to know more about what files to push.
http://wimleers.com/article/key-properties-of-a-cdn
PARALLEL REQUESTS
Problem
A single-user client SHOULD NOT maintain more than 2
connections with any server or proxy.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.htmlsec8.1.4
Solution
Serve content from multiple hostnames, a CDN.
PARALLEL REQUESTS
http://yuiblog.com/blog/2007/04/11/performance-research-part-4
WHEN NOT TO USE CDN

Flushed caches: broad, changing content

Empty caches: low traffic

Audience close to server
THE CDN MODULE

http://drupal.org/projects/cdn

Wim Leers

Supports push and pull.

File conveyor

Drupal 6 and 7
3. CDN SELECTION
Speed, reliability, cost, no BS
64K SPEED SHOWDOWN
Azure, Cotendo, Edgecast (100ms)
http://cloudclimate.com/cdn-speedtest
RELIABILITY

Server problems can be fixed

Ping times are relatively consistent

Not much to pick between them
COST
CDN
Price($)/GB
Min($)/mon
Azure
0.19
Cotendo
?
Speedyrails (Edgecast)
0.20
10.00
RackspaceCloudfiles (Akamai)
0.18
CacheFly
0.37
99.00
SoftLayer (CloudLayer)
0.20
20.00
vps.net (Level3)
0.25
Akamai
*
4.00
* Apparently
December 2011 prices. Subject to change. Variable pricing in some cases.
CDNs in bold have Origin Pull.
Origin pull CDN in bold
SPEEDYRAILS (EDGECAST)

Good network - top of class for Australia

Origin pull

Competitive, up front pricing

Low minimum per month

Responsive support
4. DEMO SETUP
Speedyrails, Edgecast, Cnames, CDN Module
http://www.flickr.com/photos/sunova_surfboards/5406715926
DEMO SITE
http://ddu2012.cruncht.net
Drupal 7 site
CDN module
Hosted westcoast USA
Uses Edgecast via Speedyrails
SPEEDYRAILS
Edgecast reseller
EDGECAST DIRECTORIES
Set up directories for small and large files
SITE DNS
Add cname pointing to CDN
EDGECAST DNS
Map the site cname to a CDN folder
CONFIGURE CDN MODULE
Map file extensions to CDN URL
TEST DRIVE
Check out the rewritten URLs
THE RESULTS
YSlow score and download times
YSLOW

Firefox plugin from Yahoo

Reports on client side page performance

Recommendations for improvements
YSLOW RESULTS
Improvement
Score
Baseline
75
Headers and deflate
81
JS aggregation
82
CSS aggregation
84
Expires
93
Etag
94
CDN
99
FIRST PAGE DOWNLOAD
Improvement
Time (s)
Baseline
2.52
headers and deflate
2.17
CDN
1.32
Expires header excluded because we want empty client cache.
No page caching.
Only based on 1 image downloaded.
CONCLUSION
CDN for the little guy
http://www.flickr.com/photos/sunova_surfboards/5415770706
CDN FOR THE LITTLE GUY

Many advantages: speed, experience, business

Useful in many cases

Good options in Australia

Easy to set up

Go forth!
THANKS!
Murray Woodman
murray.woodmanpreviousnext.com.au

QUESTIONS