Distributed Systems CS

Slides:



Advertisements
Similar presentations
Consistency and Replication Chapter 7 Part II Replica Management & Consistency Protocols.
Advertisements

Web Caching Schemes1 A Survey of Web Caching Schemes for the Internet Jia Wang.
1 Lecture 20 – Caching and Virtual Memory  2004 Morgan Kaufmann Publishers Lecture 20 Caches and Virtual Memory.
1 Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
CDNs & Replication Prof. Vern Paxson EE122 Fall 2007 TAs: Lisa Fowler, Daniel Killebrew, Jorge Ortiz.
Caching And Prefetching For Web Content Distribution Presented By:- Harpreet Singh Sidong Zeng ECE Fall 2007.
1  2004 Morgan Kaufmann Publishers Chapter Seven.
1 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: –value is stored as a charge.
1 Web Content Delivery Reading: Section and COS 461: Computer Networks Spring 2007 (MW 1:30-2:50 in Friend 004) Ioannis Avramopoulos Instructor:
Systems I Locality and Caching
FIREWALL TECHNOLOGIES Tahani al jehani. Firewall benefits  A firewall functions as a choke point – all traffic in and out must pass through this single.
Lecturer: Ghadah Aldehim
Introduction to DFS. Distributed File Systems A file system whose clients, servers and storage devices are dispersed among the machines of a distributed.
1 UNIT 13 The World Wide Web Lecturer: Kholood Baselm.
Distributed Systems CS Consistency and Replication – Part IV Lecture 21, Nov 10, 2014 Mohammad Hammoud.
NUS.SOC.CS Roger Zimmermann (based in part on slides by Ooi Wei Tsang) 1 Proxy Caching for Streaming Media.
Distributed Systems CS Consistency and Replication – Part I Lecture 10, September 30, 2013 Mohammad Hammoud.
A BRIEF INTRODUCTION TO CACHE LOCALITY YIN WEI DONG 14 SS.
Memory Hierarchy: Terminology Hit: data appears in some block in the upper level (example: Block X)  Hit Rate : the fraction of memory access found in.
1 Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4.
1  1998 Morgan Kaufmann Publishers Chapter Seven.
1 Chapter Seven. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: –value.
1 How will execution time grow with SIZE? int array[SIZE]; int sum = 0; for (int i = 0 ; i < ; ++ i) { for (int j = 0 ; j < SIZE ; ++ j) { sum +=
1 UNIT 13 The World Wide Web. Introduction 2 Agenda The World Wide Web Search Engines Video Streaming 3.
1 UNIT 13 The World Wide Web. Introduction 2 The World Wide Web: ▫ Commonly referred to as WWW or the Web. ▫ Is a service on the Internet. It consists.
MICROSOFT AJAX CDN (CONTENT DELIVERY NETWORK) Make Your ASP.NET site faster to retrieve.
Computer Architecture Lecture 25 Fasih ur Rehman.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
CS6320 – Performance L. Grewe.
Content Distribution Networks
Proxy Caching for Streaming Media
Distributed Shared Memory
Caching Temporary storage of frequently accessed data (duplicating original data stored somewhere else) Reduces access time/latency for clients Reduces.
Multilevel Memories (Improving performance using alittle “cash”)
Mohammad Malli Chadi Barakat, Walid Dabbous Alcatel meeting
E-commerce | WWW World Wide Web - Concepts
How will execution time grow with SIZE?
File System Implementation
E-commerce | WWW World Wide Web - Concepts
Chapter 12.6 Consistency and Replication
Web Caching? Web Caching:.
Cache Memory Presentation I
Internet Networking recitation #12
ECE 671 – Lecture 16 Content Distribution Networks
O.S Lecture 13 Virtual Memory.
Distributed Systems CS
Distributed Systems CS
Distributed Systems CS
Lecture: Cache Innovations, Virtual Memory
Today: Coda, xFS Case Study: Coda File System
Content Distribution Networks
Research Opportunities in IP Wide Area Storage
Distributed Systems CS
Distributed Systems CS
Outline Announcements Lab2 Distributed File Systems 1/17/2019 COP5611.
CS-447– Computer Architecture Lecture 20 Cache Memories
Distributed Systems CS
Distributed Systems CS
Distributed Systems CS
Outline Review of Quiz #1 Distributed File Systems 4/20/2019 COP5611.
Memory System Performance Chapter 3
Chapter Five Large and Fast: Exploiting Memory Hierarchy
EE 122: Lecture 22 (Overlay Networks)
Distributed Systems CS
4.01 How Web Pages Work.
Cache Memory and Performance
CSE 486/586 Distributed Systems Consistency --- 1
10/18: Lecture Topics Using spatial locality
Presentation transcript:

Distributed Systems CS 15-440 Caching – Part I Lecture 15, November 1, 2017 Mohammad Hammoud

Today… Last Lecture: Today’s Lecture: Announcements: Pregel & GraphLab Latency and Bandwidth Introduction to Caching Announcements: PS4 is due today by midnight P3 is due on Nov 12th by midnight Quiz II is on Nov 16 (during the recitation time)

Latency and Bandwidth Latency and bandwidth are partially intertwined If bandwidth is saturated Congestion occurs and latency increases If bandwidth is not at peak Congestion will not occur, but latency will NOT decrease E.g., Sending a bit on a non-congested 50Mbps medium is not going to be faster than sending 32KB Bandwidth can be easily increased, but it is inherently hard to decrease latency!

Latency and Bandwidth In reality, latency is the killer; not bandwidth Bandwidth can be improved through redundancy E.g., More pipes, fatter pipes, more lanes on a highway, more clerks at a store, etc., It costs money, but not fundamentally difficult Latency is much harder to improve Typically, it requires deep structural changes E.g., Shorten distance, reduce path length, etc., How can we reduce latency in distributed systems?

Replication and Caching One way to reduce latency is to use replication and caching What is replication? Replication is the process of maintaining several copies of data at multiple locations Afterwards, a client can access the replicated copy that is nearest to it, potentially saving latency What is caching? Caching is a special kind of client-controlled replication In particular, client-side replication is referred to as caching

Replication and Caching Example Applications Caching webpages at the client browser Caching IP addresses at clients and DNS Name Servers Replication in Content Delivery Network (CDNs) Commonly accessed contents, such as software and streaming media, are cached at various network locations Main Server Replicated Servers

Can businesses benefit from caching without giving up control? Dilemma CDNs address a major dilemma Businesses want to know your every click and keystroke This is to maintain deep, intimate knowledge of clients Client-side caching hides this knowledge from servers So, servers mark pages as “uncacheable” This is often a lie, because the content is actually cacheable But, the lack of caching hurts latency and subsequently user experience!! Can businesses benefit from caching without giving up control?

CDNs: A Solution to this Dilemma Third party caching sites (or providers) provide hosting services, which are trusted by businesses A provider owns a collection of servers across the Internet Typically, its hosting service can dynamically replicate files on different servers E.g., Based on the popularity of a file in a region Examples: Akamai (which pioneered CDN in the late 1990s) Amazon CloudFront CDN Windows Azure CDN

CDNs: A Solution to this Dilemma

Client- vs. Server-side Replication Would replication help if clients perform non-overlapping requests to data objects? Yes, through client-side caching A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code

Client- vs. Server-side Replication Would replication help if clients perform non-overlapping requests to data objects? Yes, through client-side caching Server Client 1 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3

Client- vs. Server-side Replication Would replication help if clients perform non-overlapping requests to data objects? Yes, through client-side caching Server Client 1 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3

Client- vs. Server-side Replication Would replication help if clients perform non-overlapping requests to data objects? Yes, through client-side caching Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 O1

Client- vs. Server-side Replication Would replication help if clients perform non-overlapping requests to data objects? Yes, through client-side caching Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 O1

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would replication help if clients perform overlapping requests to data objects? Yes, through server-side replication Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would combined client- and server-side replication help if clients perform overlapping requests to data objects? Yes A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code

Client- vs. Server-side Replication Would combined client- and server-side replication help if clients perform overlapping requests to data objects? Yes Server Client 1 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy

Client- vs. Server-side Replication Would combined client- and server-side replication help if clients perform overlapping requests to data objects? Yes Server Client 1 O0 O0 A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code O0 O1 Client 2 O2 O3 Proxy O0

Local storage used for client-side replicas is referred to as “cache” Caching We will focus first on caching then replication The basic idea of caching (it is very simple): A data object is stored far away A client needs to make multiple references to that object A copy (or a replica) of that object can be created and stored nearby The client can transparently access the replica instead Local storage used for client-side replicas is referred to as “cache”

Simple Cache Metrics References = Number of attempts to find an object in a cache Hits = Number of successes Misses = Number of failures Miss Ratio = Misses/References Hit Ratio = Hits/References = (1 − Miss Ratio) Expected Cost of a Reference = (Miss Ratio × cost of miss) + (Hit Ratio × cost of hit) Cache Advantage = (Cost of Miss / Cost of Hit) Where cost is measured in time delay to access an object A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code

Why Caching is Effective? Applications tend to reuse data they accessed recently Referred to as the principle of locality Two different types of locality: Temporal locality Recently accessed objects are likely to be accessed again Spatial locality Objects that are near one another are likely to be accessed successively

Why Caching is Effective? The principle of locality enables: Effective caching Prefetching I.e., Fetching an object that is likely to be requested before it is actually requested, thus resulting in a cache hit when requested Enabled especially by spatial locality Applications with (minimal or) no data reuse (e.g., a streaming application like streaming a video), do not benefit from caching They may though benefit from prefetching

Temporal and Spatial Localities Temporal and spatial localities are very different Caching implementations often tightly combine them One can exist without the other Spatial without temporal (e.g., linear scan of huge file) Temporal without spatial (e.g., tight loop accessing just one object) Example: “rm -f *” The shell expands “*” into a list The loop iterates through the list stat object unlink object The parent directory exhibits temporal locality The directory entries exhibit spatial locality A widely held rule of thumb is that a program spends 90% of its execution time in only 10% of the code

Three Key Questions What data should be cached and when? Fetching Policy How can updates be made visible everywhere? Consistency or Update Propagation Policy What data should be evicted to free up space? Cache Replacement Policy

Next Class Continue with Caching…