Lecture 23 The Andrew File System. NFS Architecture client File Server Local FS RPC.

Slides:



Advertisements
Similar presentations
Serverless Network File Systems. Network File Systems Allow sharing among independent file systems in a transparent manner Mounting a remote directory.
Advertisements

CS-550: Distributed File Systems [SiS]1 Resource Management in Distributed Systems: Distributed File Systems.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Lecture 18 ffs and fsck. File-System Case Studies Local FFS: Fast File System LFS: Log-Structured File System Network NFS: Network File System AFS: Andrew.
Copyright © Clifford Neuman - UNIVERSITY OF SOUTHERN CALIFORNIA - INFORMATION SCIENCES INSTITUTE CS582: Distributed Systems Lecture 13, 14 -
Distributed File Systems
Consistency in NFS and AFS. Network File System (NFS) Uses client caching to reduce network load Built on top of RPC Server cache: X Client A cache: XClient.
CMPT Dr. Alexandra Fedorova Lecture VII: Distributed File Systems.
Other File Systems: LFS and NFS. 2 Log-Structured File Systems The trend: CPUs are faster, RAM & caches are bigger –So, a lot of reads do not require.
Other File Systems: AFS, Napster. 2 Recap NFS: –Server exposes one or more directories Client accesses them by mounting the directories –Stateless server.
Distributed File System: Design Comparisons II Pei Cao Cisco Systems, Inc.
G Robert Grimm New York University Scale and Performance in Distributed File Systems: AFS and SpriteFS.
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
CSE 490dp Resource Control Robert Grimm. Problems How to access resources? –Basic usage tracking How to measure resource consumption? –Accounting How.
Distributed File System: Design Comparisons II Pei Cao.
Case Study - GFS.
File Systems (2). Readings r Silbershatz et al: 11.8.
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM R. Sandberg, D. Goldberg S. Kleinman, D. Walsh, R. Lyon Sun Microsystems.
Distributed File Systems Sarah Diesburg Operating Systems CS 3430.
Graybox NFS Caching Proxy By: Paul Cychosz and Garrett Kolpin.
Distributed File Systems Concepts & Overview. Goals and Criteria Goal: present to a user a coherent, efficient, and manageable system for long-term data.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Distributed File Systems Steve Ko Computer Sciences and Engineering University at Buffalo.
1 The Google File System Reporter: You-Wei Zhang.
CSC 456 Operating Systems Seminar Presentation (11/13/2012) Leon Weingard, Liang Xin The Google File System.
Networked File System CS Introduction to Operating Systems.
Distributed Systems. Interprocess Communication (IPC) Processes are either independent or cooperating – Threads provide a gray area – Cooperating processes.
Distributed File Systems
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
Distributed File Systems Case Studies: Sprite Coda.
Distributed file systems, Case studies n Sun’s NFS u history u virtual file system and mounting u NFS protocol u caching in NFS u V3 n Andrew File System.
Distributed File Systems Overview  A file system is an abstract data type – an abstraction of a storage device.  A distributed file system is available.
Chapter 20 Distributed File Systems Copyright © 2008.
What is a Distributed File System?? Allows transparent access to remote files over a network. Examples: Network File System (NFS) by Sun Microsystems.
Introduction to DFS. Distributed File Systems A file system whose clients, servers and storage devices are dispersed among the machines of a distributed.
MapReduce and GFS. Introduction r To understand Google’s file system let us look at the sort of processing that needs to be done r We will look at MapReduce.
Jinyong Yoon,  Andrew File System  The Prototype  Changes for Performance  Effect of Changes for Performance  Comparison with A Remote-Open.
Sun Network File System Presentation 3 Group A4 Sean Hudson, Syeda Taib, Manasi Kapadia.
Caching in the Sprite Network File System Scale and Performance in a Distributed File System COMP 520 September 21, 2004.
Distributed File Systems
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
Lecture 24 Sun’s Network File System. PA3 In clkinit.c.
EE324 INTRO TO DISTRIBUTED SYSTEMS. Distributed File System  What is a file system?
Manish Kumar,MSRITSoftware Architecture1 Remote procedure call Client/server architecture.
Distributed File Systems Group A5 Amit Sharma Dhaval Sanghvi Ali Abbas.
Lecture 25 The Andrew File System. NFS Architecture client File Server Local FS RPC.
Distributed File Systems Questions answered in this lecture: Why are distributed file systems useful? What is difficult about distributed file systems?
Chapter Five Distributed file systems. 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems.
DISTRIBUTED FILE SYSTEM- ENHANCEMENT AND FURTHER DEVELOPMENT BY:- PALLAWI(10BIT0033)
Lecture 22 Sun’s Network File System
Distributed File Systems
Distributed File Systems
Andrew File System (AFS)
NFS and AFS Adapted from slides by Ed Lazowska, Hank Levy, Andrea and Remzi Arpaci-Dussea, Michael Swift.
Filesystems 2 Adapted from slides of Hank Levy
Distributed File Systems
Today: Coda, xFS Case Study: Coda File System
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Scale and Performance in a Distributed File System
Distributed File Systems
DISTRIBUTED FILE SYSTEMS
Distributed File Systems
CSE 451: Operating Systems Spring Module 21 Distributed File Systems
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM
Distributed File Systems
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Chapter 15: File System Internals
University of Southern California Information Sciences Institute
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distributed File Systems
Distributed File Systems
Presentation transcript:

Lecture 23 The Andrew File System

NFS Architecture client File Server Local FS RPC

NFS Export local FS to network many machines may export and mount Fast+simple crash recovery both clients and file server may crash Transparent access can’t tell it’s over the network normal UNIX semantics Reasonable performance

General Strategy: Export FS Server Local FS Client Local FSNFS read

NFS Protocol Examples NFSPROC_GETATTR expects: file handle returns: attributes NFSPROC_SETATTR expects: file handle, attributes returns: nothing NFSPROC_LOOKUP expects: directory file handle, name of file/directory to look up returns: file handle NFSPROC_READ expects: file handle, offset, count returns: data, attributes NFSPROC_WRITE expects: file handle, offset, count, data returns: attributes

Reading A File: Client-side And File Server Actions

NFS Server Failure Handling If at first you don’t succeed, and you’re stateless and idempotent, then try, try again.

Update Visibility Solution A client may buffer a write. How can server and other clients see it? NFS solution: flush on fd close (not quite like UNIX) Performance implication for short-lived files?

Stale Cache Solution A client may have a cached copy that is obsolete. NFS solution: clients recheck if cache is current before using it. Cache metadata records when data was fetched. Also make the attribute cache entries expire after a given time (say 3 seconds). If cache has expired, client does a GETATTR request to server: get’s last modified timestamp, compare to cache, and refetch if necessary

Andrew File System Main goal: scale many clients per server Large number of clients Client performance not as important Central store for shared data, not diskless workstations Consistency Some model you can program against Reliability Need to handle client & server failures Naming Want global name space, not per-machine name space

Prefetching AFS paper notes: “the study by Ousterhout et al. has shown that most files in a 4.2BSD environment are read in their entirety.” What are the implications for prefetching policy? Aggressively prefetch whole files.

Whole-File Caching Upon open, AFS fetches whole file (even if it’s huge), storing it in local memory or disk. Upon close, whole file is flushed (if it was written). Convenient: AFS needs to do work for open/close reads/writes are local

AFS V1 open: The client-side code intercepts open-system-call; decide ‘is this local file or remote’ contact a server (through the full path string in AFS-1) in case of remote files Server side: locate the file; send the whole file to client Client side: take the whole file, put it in local disk, return a file-descriptor to user-level read/write: on the client side copy if the file has not been modified close: send the entire file and pathname to the server if the file has been modified

AFS Design NFS: export local FS No need to explicitly mount at client side There are clear boundary between servers and clients (different from NFS) Require local disk! No kernel modification

Why is this Inefficient? Requests to server: fd1 = open(“/a/b/c/d/e/1.txt”) fd2 = open(“/a/b/c/d/e/2.txt”) fd3 = open(“/a/b/c/d/e/3.txt”) Same inodes and dir entries repeatedly read.

Solution Server returns dir entries to client. Client caches entries, inodes. Pro: partial traversal is the common case. Con: first lookup requires many round trips.

Measure then re-build Evaluation performance: Andrew Benchmark used by many others Make dir – create directory tree: stresses metadata Copy – copy in files – stresses file writes / creates Scan Dir (like ls –R) – stresses metadata reads ReadAll – find. | wc – stresses whole file reads Make – may be CPU bound, does lots of reads + fewer writes What is missing? All pieces do whole-file reads / writes Missing productivity applications, scientific applications

Measure then re-build Low scalability: performance got a lot worse (on clients) when # of clients goes up QUESTION: what was bottleneck? Server disk? Seek time ? disk BW? Server CPU? Network? Client CPU/Disk? Main problems for AFSv1 Path-traversal costs are too high The client issues too many TestAuth protocol messages Load was not balanced Too many processes

Cache Consistency Update visibility Stale cache

“Update Visibility” problem server doesn’t have latest Client NFS Cache: A Server Local FS Cache: A Client NFS Cache: A NFS Cache: B Local FS Cache: B flush

Update Visibility Solution Clients updates not seen on servers yet. NFS solution is flush blocks: on close() when low on memory Problems flushes not atomic (one block at a time) two clients flush at once: mixed data

Update Visibility Solution Clients updates not seen on servers yet. AFS solution: flush on close buffer whole files on local disk Concurrent writes? Last writer (i.e., closer) wins. Never get mixed data.

“Stale Cache” problem client doesn’t have latest Client NFS Cache: B Server Local FS Cache: B Client NFS Cache: A NFS Cache: B read

Stale Cache Solution Clients have old version NFS rechecks cache entries before using them, assuming a check hasn’t been done “recently”. “Recent” is too long: ? “Recent” is too short: ?

Stale Cache Solution AFS solution: tell clients when data is overwritten. When clients cache data, ask for “callback” from server. No longer stateless! Relaxed but well-defined consistency semantics Get latest value on open Changes visible on close Read/write purely local – get local unix semantics

AFSv2 Reading a File

Callbacks What if client crashes? What if server runs out of memory? What if server crashes?

Client Crash What should client do after reboot? Option 1: evict everything from cache Option 2: recheck before using

Low Server Memory Strategy: tell clients you are dropping their callback. What should client do? Mark entry for recheck. How does server choose which entry to bump? Sadly, it doesn’t know which is most useful.

Server Crashes What if server crashes? Option: tell everybody to recheck everything before next read. Clients need to be aware of server crash Option: persist callbacks.

Scale And Performance Of AFSv2 AFSv2 was measured and found to be much more scalable that the original version Client-side performance often came quite close to local performance

Comparison: AFS vs. NFS

Process Structure For each client, a different process ran on the server. Context switching costs were high. Solution: use threads.

Other improvement A true global namespace Security Flexible user-managed access control System management tools

Summary Multi-step copy and forwarding make volume migration fast and consistent. Workload drives design: whole-file caching. State is useful for scalability, but makes consistency hard.