Unformatted text preview:

CS162 Operating Systems and Systems Programming Lecture 24 Distributed File Systems April 30 2008 Prof Anthony D Joseph http inst eecs berkeley edu cs162 Review Virtual File System VFS VFS Virtual abstraction similar to local file system Instead of inodes has vnodes Compatible with a variety of local and remote file systems provides object oriented way of implementing file systems VFS allows the same system call interface the API to be used for different types of file systems The API is to the VFS interface rather than any specific type of file system 4 28 08 Joseph CS162 UCB Spring 2008 Lec 24 2 Goals for Today Examples of Distributed File Systems Cache Coherence Protocols Worms and Viruses Note Some slides and or pictures in the following are adapted from slides 2005 Silberschatz Galvin and Gagne Many slides generated from my lecture notes by 4 28 08 Lec 24 3 Kubiatowicz Joseph CS162 UCB Spring 2008 Simple Distributed File System Read RPC Return Data Client C P R e t i Wr K AC Servercache Client Remote Disk Reads and writes forwarded to server Use RPC to translate file system calls No local caching can be caching at server side Advantage Server provides completely consistent view of file system to multiple clients Problems Performance Going over network is slower than going to local memory Lots of network traffic not well pipelined Server can be a bottleneck 4 28 08 Joseph CS162 UCB Spring 2008 Lec 24 4 Use of caching to reduce network load read f1 V1 cache read f1 V1 read f1 V1 F1 V1 Client read f1 V1 write f1 OK read f1 V2 cache F1 V2 Read RPC Return Data C P R e it r W K AC Servercache F1 V2 F1 V1 Client Idea Use caching to reduce network load In practice use buffer cache at source and destination Advantage if open read write close can be done locally don t need to do any network traffic fast Problems Failure Client caches have data not committed at server Cache consistency Client caches not consistent with server each other 4 28 08 Joseph CS162 UCB Spring 2008 Lec 24 5 Failures Crash What if server crashes Can client wait until server comes back up and continue as before Any data in server memory but not on disk can be lost Shared state across RPC What if server crashes after seek Then when client does read it will fail Message retries suppose server crashes after it does UNIX rm foo but before acknowledgment Message system will retry send it again How does it know not to delete it again could solve with two phase commit protocol but NFS takes a more ad hoc approach Stateless protocol A protocol in which all information required to process a request is passed with request Server keeps no state about client except as hints to help improve performance e g a cache Thus if server crashes and restarted requests can continue where left off in many cases What if client crashes Might 4 28 08 lose modified data in Spring client cache Joseph CS162 UCB 2008 Lec 24 6 World Wide Web Key idea graphical front end to RPC protocol What happens when a web server fails System breaks Solution Transport or network layer redirection Invisible to applications Can also help with scalability load balancers Must handle sessions e g banking ecommerce Initial version no caching Didn t scale well easy to overload servers 4 28 08 Joseph CS162 UCB Spring 2008 Lec 24 7 WWW Caching Use client side caching to reduce number of interactions between clients and servers and or reduce the size of the interactions Time to Live TTL fields HTTP Expires header from server Client polling HTTP If Modified Since request headers from clients Server refresh HTML META Refresh tag causes periodic client poll What is the polling frequency for clients and servers Could be adaptive based upon a page s age and its rate of change Server load is still significant 4 28 08 Joseph CS162 UCB Spring 2008 Lec 24 8 WWW Proxy Caches Place caches in the network to reduce server load But increases latency in lightly loaded case Caches near servers called reverse proxy caches Offloads busy server machines Caches at the edges of the network called content distribution networks Offloads servers and reduce client latency Challenges Caching static traffic easy but only 40 of traffic Dynamic and multimedia is harder Multimedia is a big win Megabytes versus Kilobytes Same cache consistency problems as before Caching is changing the Internet architecture Places functionality at higher levels of comm protocols 4 28 08 Joseph CS162 UCB Spring 2008 Lec 24 9 Schematic View of NFS Architecture 4 28 08 Joseph CS162 UCB Spring 2008 Lec 24 10 Administrivia Project 4 design deadline is Thu 5 1 at 11 59pm See newsgroup for design doc details Code deadline is Wed 5 14 Final Exam May 21st 12 30 3 30pm Final Topics Any suggestions Please send them to me 4 28 08 Joseph CS162 UCB Spring 2008 Lec 24 11 Network File System NFS Three Layers for NFS system UNIX file system interface open read write close calls file descriptors VFS layer distinguishes local from remote files Calls the NFS protocol procedures for remote requests NFS service layer bottom layer of the architecture Implements the NFS protocol NFS Protocol RPC for file operations on server Reading searching a directory manipulating links and directories accessing file attributes reading and writing files Write through caching Modified data committed to server s disk before results are returned to the client lose some of the advantages of caching time to perform write can be long Need some mechanism for readers to eventually on Spring this 2008 later 4 28 08notice changes Joseph more CS162 UCB Lec 24 12 NFS Continued NFS servers are stateless each request provides all arguments require for execution E g reads include information for entire operation such as ReadAt inumber position not Read openfile No need to perform network open or close on file each operation stands on its own Idempotent Performing requests multiple times has same effect as performing it exactly once Example Server crashes between disk I O and message send client resend read server does operation again Example Read and write file blocks just re read or rewrite file block no side effects Example What about remove NFS does operation twice and second time returns an advisory error Failure Model Transparent to client system Is this a good idea What if you are in the middle of reading a file and server crashes Options NFS Provides both Hang until server comes back up next week Return an error Of course most applications don t know they are


View Full Document

Berkeley COMPSCI 162 - Lecture 24 Distributed File Systems

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Loading Unlocking...
Login

Join to view Lecture 24 Distributed File Systems 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 Lecture 24 Distributed File Systems 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?