Distributed Systems CS

Slides:



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

Cache Coherent Distributed Shared Memory. Motivations Small processor count –SMP machines –Single shared memory with multiple processors interconnected.
Business Continuity and DR, A Practical Implementation Mich Talebzadeh, Consultant, Deutsche Bank
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Web Caching Schemes1 A Survey of Web Caching Schemes for the Internet Jia Wang.
What’s a Web Cache? Why do people use them? Web cache location Web cache purpose There are two main reasons that Web cache are used:  to reduce latency.
EEC-681/781 Distributed Computing Systems Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Distributed File System: Design Comparisons II Pei Cao Cisco Systems, Inc.
CS252/Patterson Lec /28/01 CS 213 Lecture 10: Multiprocessor 3: Directory Organization.
Client-Server Computing in Mobile Environments
Multiprocessor Cache Coherency
FIREWALL TECHNOLOGIES Tahani al jehani. Firewall benefits  A firewall functions as a choke point – all traffic in and out must pass through this single.
1 Content Distribution Networks. 2 Replication Issues Request distribution: how to transparently distribute requests for content among replication servers.
Distributed File Systems Concepts & Overview. Goals and Criteria Goal: present to a user a coherent, efficient, and manageable system for long-term data.
Distributed File Systems
Distributed File Systems Overview  A file system is an abstract data type – an abstraction of a storage device.  A distributed file system is available.
Computing Infrastructure for Large Ecommerce Systems -- based on material written by Jacob Lindeman.
Introduction to DFS. Distributed File Systems A file system whose clients, servers and storage devices are dispersed among the machines of a distributed.
Ch 10 Shared memory via message passing Problems –Explicit user action needed –Address spaces are distinct –Small Granularity of Transfer Distributed Shared.
Distributed Shared Memory Based on Reference paper: Distributed Shared Memory, Concepts and Systems.
Web Cache Consistency. “Requirements of performance, availability, and disconnected operation require us to relax the goal of semantic transparency.”
Distributed Systems CS Consistency and Replication – Part IV Lecture 21, Nov 10, 2014 Mohammad Hammoud.
Computer Science Lecture 14, page 1 CS677: Distributed OS Last Class: Concurrency Control Concurrency control –Two phase locks –Time stamps Intro to Replication.
HTTP evolution - TCP/IP issues Lecture 4 CM David De Roure
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT By Jyothsna Natarajan Instructor: Prof. Yanqing Zhang Course: Advanced Operating Systems.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
Review CS File Systems - Partitions What is a hard disk partition?
DISTRIBUTED FILE SYSTEM- ENHANCEMENT AND FURTHER DEVELOPMENT BY:- PALLAWI(10BIT0033)
CS6320 – Performance L. Grewe.
Distributed Shared Memory
Lecture 12 Virtual Memory.
Andrew File System (AFS)
How will execution time grow with SIZE?
The University of Adelaide, School of Computer Science
File System Implementation
Multiprocessor Cache Coherency
Web Caching? Web Caching:.
Ivy Eva Wu.
Utilization of Azure CDN for the large file distribution
Net 323: NETWORK Protocols
Chapter 16: Distributed System Structures
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT -Sumanth Kandagatla Instructor: Prof. Yanqing Zhang Advanced Operating Systems (CSC 8320)
CMSC 611: Advanced Computer Architecture
Example Cache Coherence Problem
O.S Lecture 13 Virtual Memory.
Distributed Systems CS
Distributed Systems CS
Outline Midterm results summary Distributed file systems – continued
Distributed Systems CS
Distributed Systems CS
Today: Coda, xFS Case Study: Coda File System
EECS 498 Introduction to Distributed Systems Fall 2017
CS240: Advanced Programming Concepts
Distributed Systems CS
Chapter 5 Exploiting Memory Hierarchy : Cache Memory in CMP
CS 213 Lecture 11: Multiprocessor 3: Directory Organization
Outline Announcements Lab2 Distributed File Systems 1/17/2019 COP5611.
Slides developed by Dr. Hesham El-Rewini Copyright Hesham El-Rewini
Distributed Systems CS
CSE451 Virtual Memory Paging Autumn 2002
Replica Placement Model: We consider objects (and don’t worry whether they contain just data or code, or both) Distinguish different processes: A process.
Distributed Systems CS
The University of Adelaide, School of Computer Science
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Outline Review of Quiz #1 Distributed File Systems 4/20/2019 COP5611.
EE 122: Lecture 22 (Overlay Networks)
Distributed Systems CS
Distributed Resource Management: Distributed Shared Memory
Lecture 23: Transactional Memory
The University of Adelaide, School of Computer Science
Presentation transcript:

Distributed Systems CS 15-440 Caching – Part I Lecture 20, November 26, 2018 Mohammad Hammoud

Today… Last Lecture: Today’s Lecture: Announcements: GraphLab Caching- Part I Announcements: P3 is due today by midnight P4 will be out by tomorrow

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”

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

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

Fetching Policy Two broad types: Push-based fetching policy Pull-based fetching policy

Push-Based Caching Push-based Caching (or Full Replication) Every participating machine gets a complete copy of data in advance Every new file gets pushed to all participating machines Every update on a file is pushed immediately to every corresponding replica Example: Dropbox Works well enough in practice (technical excellence is only weakly correlated to business success)

Push-Based Caching: Scalability Issues Clearly, this can create a major scalability issue With larger team sizes and/or datasets, the push-based model consumes larger amounts of network bandwidth and disk spaces At very large-scale, it might take a day to finish a sync operation! This defeats the very purpose of full replication, which is usually to enable collaboration among teams A different approach referred to as pull-based caching attempts to solve this problem

Pull-Based Caching Pull-based Caching (or On-demand Caching) A file is fetched only if needed Updates on a file (not necessarily the whole file) are propagated to replicated files only if needed This leads to a more fine-grained and selective approach (as opposed to the push-based model) for data management Examples: AFS

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

One-Copy Semantic Caching Reality Desired Illusion One-Copy Semantic

One-Copy Semantic A caching system has one-copy semantic if and only if: There are no externally observable functional differences with respect to an equivalent system that does no caching However, performance/timing differences may be visible This is very difficult to achieve in practice Except in very narrow circumstances like HPC-oriented file systems and DSMs All real implementations are approximations

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Broadcast Invalidations A write goes as follows: Reads on cached objects can proceed directly (F1, F2, F3) Server Go Ahead Need to Write on F1 Write- back F1 Invalidate F1 (F1) Client 1 Write on F1 Ack (F2) (F1, F2) Client 2 Negative-Ack (F3) Client 3

Broadcast Invalidations The server does not maintain a directory that keeps track of who is currently caching every object Thus, upon any update to any object, the server broadcasts an invalidation message to every caching site If a site is caching the object, it invalidates it; otherwise, it sends a negative Ack message to the server If invalidated, next reference to this object at this site will cause a miss

Broadcast Invalidations Advantages: No special state (except locations of caching sites) is maintained at the server A stateless server No race conditions can occur if an updater blocks until all the cached copies of the requested object (except its own) are invalidated Very strict emulation of the one-copy semantic Simple to implement

Broadcast Invalidations Disadvantages: Traffic is wasted, especially if no site caches the requested object The updater blocks until the invalidation process is completed Not scalable in large networks Could lead to flooding the network if the number of writes is high and the read/write ratio is low Requires that all sites listen (or snoop) to all requests

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Check on Use The server does not invalidate cached copies upon updates Rather, a requestor at any site checks with the server before using any object Versioning can be used, wherein each copy of a file is given a version number Is my copy still valid? If no, fetch a new copy of the object If yes and I am a reader, proceed If yes and I am a writer, proceed and write-back when done

Check on Use Has to be done at coarse-granularity (e.g., entire file or large blocks) Otherwise, reads are slowed down excessively It results in session semantic if done at whole file granularity Open {Read | Write}* Close  “session” Updates on an open file are initially visible only to the updater of the file Only when the file is closed, the changes are made visible to the server

Check on Use Disadvantages: Concurrent Updates! “Up-to-date” is relative to network latency (F) Server Is version of file F still X? YES YES Write-Back (F) Client 1 Update Is version of file F still X? Write-Back (F) Client 2 Update Concurrent Updates!

Check on Use Disadvantages: How to handle concurrent writes? The final result depends on whose write-back arrives last at the server This gets impacted by network latency If updates A and B are exactly the same And the machines where they are pursued are homogenous And A is started, finished, and sent before B It is not necessary that A will reach the server before B Slow reads Especially with loaded servers and high-latency networks

Check on Use Disadvantages: Advantages: Pessimistic approach, especially with read-most workloads Can we employ an optimistic (or Trust-and-Verify) approach? Advantages: Strict consistency (not across all copies) at coarse granularity No special server state is needed Servers do not need to know anything about caching sites Easy to implement

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Callback A write goes as follows: Reads on cached objects can proceed directly (F1, F2, F3) Server Go Ahead Write- back F1 Need to Write on F1 Invalidate F1 (F1) Client 1 Write on F1 Ack (F2) (F1, F2) Client 2 (F3) Client 3

Callback The server maintains a directory that keeps track of who is currently caching every object Thus, upon an update to an object, the server sends invalidation messages (i.e., or callbacks) only to sites that are currently caching the object Typically done at coarse granularity (e.g., entire file) Can be made to work with byte ranges

Callback Advantages: Targeted notification of caching sites Zero network traffic for reads of cached objects Biases read performance in favor of write- performance Excellent scalability, especially with read-most workloads

Callback Disadvantages: Complexity of tracking cached objects on clients Sizable state on server Silence at the server is ambiguous for clients What if a client has been reading a file for a little while without hearing back from the server? Perhaps the server is down A keep-alive (or heartbeat) mechanism can be incorporated, whereby the server pings the clients (or the other way around) every now and then indicating that he is still alive

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Leases A requestor needs to obtain a finite-duration control from the server This duration is called a lease period (typically, for few seconds) There are three types of leases Read and write leases, assuming an invalidation-based protocol Multiple requestors can obtain read leases on the same object, but only one can get a write lease on any object Open leases, assuming a check-on-use protocol A requestor loses control when its lease expires If needed, the requestor can renew the lease

Synchronized Clocks are Assumed at All Sites Lease Renewal Example: (F) Server Sorry, I can give you a read lease for time Y on F Renew my read lease for another time Y on F Okay, you got an extension for Y time on your read lease over F Give me a read lease for time X on F (F) Client 1 Read F for duration Y Read F for duration Y Synchronized Clocks are Assumed at All Sites

Next Class Continue on cache consistency approaches