UW-Madison CS 640 - Improving Web Experience

Unformatted text preview:

1CS640: Introduction to Computer NetworksAditya AkellaLecture 18 -Improving Web Experience:Caching and CDNs2HTTP Caching• Why caching?• Clients often cache documents– Challenge: update of documents– If-Modified-Since requests to check• HTTP 0.9/1.0 used just date• HTTP 1.1 has an opaque “entity tag” (could be a file signature, etc.) as well• When/how often should the original be checked for changes?– Check every time?– Check each session? Day? Etc?– Use “Expires” header• If no Expires, often use Last-Modified as estimate3Example Cache Check RequestGET / HTTP/1.1Accept: */*Accept-Language: en-usAccept-Encoding: gzip, deflateIf-Modified-Since: Mon, 29 Jan 2001 17:54:18 GMTIf-None-Match: "7a11f-10ed-3a75ae4a"User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)Host: www.intel-iris.netConnection: Keep-Alive24Example Cache Check ResponseHTTP/1.1 304 Not ModifiedDate: Tue, 27 Mar 2001 03:50:51 GMTServer: Apache/1.3.14 (Unix) (Red-Hat/Linux) mod_ssl/2.7.1 OpenSSL/0.9.5a DAV/1.0.2 PHP/4.0.1pl2 mod_perl/1.24Connection: Keep-AliveKeep-Alive: timeout=15, max=100ETag: "7a11f-10ed-3a75ae4a"5Web CachesAssumptions• Average object size = 100,000 bits• Avg. request rate from institution’s browser to origin servers = 15/sec• Delay from institutional router to any origin server and back to router = 2 secConsequences• Utilization on LAN = 15%• Utilization on access link = 100%• Total delay = Internet delay + access delay + LAN delay= 2 sec + minutes + millisecondsoriginserverspublicInternetinstitutionalnetwork10 Mbps LAN1.5 Mbps access link6Web CachesPossible solution• Increase bandwidth of access link to, say, 10 Mbps• Often a costly upgradeConsequences• Utilization on LAN = 15%• Utilization on access link = 15%• Total delay = Internet delay + access delay + LAN delay= 2 sec + msecs + msecsoriginserverspublicInternetinstitutionalnetwork10 Mbps LAN10 Mbps access link37Web CachesInstall cache• Suppose hit rate is .4Consequence• 40% requests will be satisfied almost immediately (say 10 msec)• 60% requests satisfied by origin server• Utilization of access link reduced to 60%, resulting in negligible delays• Weighted average of delays= .6*2 sec + .4*10msecs < 1.3 secsoriginserverspublicInternetinstitutionalnetwork10 Mbps LAN1.5 Mbps access linkinstitutionalcache8Web Proxy Caches• User configures browser: Web accesses via cache• Browser sends all HTTP requests to cache– Object in cache: cache returns object – Else cache requests object from origin server, then returns object to clientclientProxyserverclientHTTP requestHTTP requestHTTP responseHTTP responseHTTP requestHTTP responseorigin serverorigin server9Problems• Over 50% of all HTTP objects are uncacheable – why?• Not easily solvable– Dynamic data  stock prices, scores, web cams– CGI scripts  results based on passed parameters– SSL  encrypted data is not cacheable• Most web clients don’t handle mixed pages well many generic objects transferred with SSL– Cookies  results may be based on passed data– Hit metering  owner wants to measure # of hits for revenue, etc.410Server Selection• Replicate content on many servers– Load and latency savings• Challenges– Which content to replicate– How to replicate content– Where to place replicas– How to find replicated content– How to choose among know replicas– How to direct clients towards replica11Server Selection• Which server?– Lowest load  to balance load on servers– Best performance  to improve client performance• Based on Geography? RTT? Throughput? Load?– Any alive node  to provide fault tolerance• How to direct clients to a particular server?– As part of routing  anycast, cluster load balancing• Not covered today…– As part of application  HTTP redirect– As part of naming  DNS12Application-Based Redirection• HTTP supports simple way to indicate that Web page has moved (30X responses)• Server receives Get request from client– Decides which server is best suited for particular client and object– Returns HTTP redirect to that server• Can make informed application specific decision• May introduce additional overhead  multiple connection setup, name lookups, etc.513Naming Based• Client does name lookup for service• Name server chooses appropriate server address– A-record returned is “best” one for the client• What information can name server base decision on?– Server load/location  must be collected– Information in the name lookup request• Name service client  typically the local name server for client14Content Distribution Networks (CDNs)• The content providers are the CDN customers.Content replication• CDN company installs hundreds of CDN servers throughout Internet– Close to users• CDN replicates its customers’ content on CDN servers in an on demandfashion.• Example: Akamai networks15How Akamai Works• Clients fetch html document from primary server– E.g. fetch index.html from cnn.com• “Akamaized” URLs for replicated content are replaced in html– E.g. <img src=“http://cnn.com/af/x.gif”> replaced with <imgsrc=“http://a73.g.akamaitech.net/7/23/cnn.com/af/x.gif”>• Client is forced to resolve aXYZ.g.akamaitech.net hostname616How Akamai Works• Only static content is “Akamaized”• Modified name contains original file name and content provider ID• Akamai server is asked for content– First checks local cache– If not in cache, requests file from primary server; caches file17Overview of How Akamai WorksEnd-usercnn.com (content provider) DNS root server1 2 34Akamai high-level DNS serverAkamai low-level DNS serverNearby matchingAkamai server11678910Get index.htmlGet /cnn.com/foo.jpg12Get foo.jpg518Akamai – Subsequent RequestsEnd-usercnn.com (content provider) DNS root server1 2Akamai high-level DNS serverAkamai low-level DNS server78910Get index.htmlGet /cnn.com/foo.jpgNearby matchingAkamai server719Recap: How Akamai Works• Root server gives NS record for akamai.net• Akamai.net name server returns NS record for g.akamaitech.net– Name server chosen to be in region of client’s name server• Out-of-band measurements to obtain this• G.akamaitech.net nameserver chooses server in region– A collection of serves in each region– Which server to choose?– Uses aXYZ name20Simple Hashing• Given document XYZ, we need to choose a server to use•


View Full Document

UW-Madison CS 640 - Improving Web Experience

Documents in this Course
Security

Security

21 pages

Mobile IP

Mobile IP

16 pages

Lecture 7

Lecture 7

36 pages

Multicast

Multicast

38 pages

Load more
Download Improving Web Experience
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Improving Web Experience and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Improving Web Experience 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?