For example, we have relaxed GFS’s consistency model tovastly simplify the file system without imposing an onerousburden on the applications. We have also introduced anatomic append operation so that multiple clients can appendconcurrently to a file without extra synchronization betweenthem. These will be discussed in more details later in thepaper.Multiple GFS clusters are currently deployed for differentpurposes. The largest ones have over 1000 storage nodes,over 300 TB of disk storage, and are heavily accessed byhundreds of clients on distinct machines on a continuousbasis.
2. DESIGN OVERVIEW2.1 Assumptions
In designing a file system for our needs, we have beenguided by assumptions that offer both challenges and op-portunities. We alluded to some key observations earlierand now lay out our assumptions in more details.
•
The system is built from many inexpensive commoditycomponents that often fail. It must constantly monitoritself and detect, tolerate, and recover promptly fromcomponent failures on a routine basis.
•
The system stores a modest number of large files. Weexpect a few million files, each typically 100 MB orlarger in size. Multi-GB files are the common caseand should be managed efficiently. Small files must besupported, but we need not optimize for them.
•
The workloads primarily consist of two kinds of reads:large streaming reads and small random reads. Inlarge streaming reads, individual operations typicallyread hundreds of KBs, more commonly 1 MB or more.Successive operations from the same client often readthrough a contiguous region of a file. A small ran-dom read typically reads a few KBs at some arbitraryoffset. Performance-conscious applications often batchand sort their small reads to advance steadily throughthe file rather than go back and forth.
•
The workloads also have many large, sequential writesthat append data to files. Typical operation sizes aresimilar to those for reads. Once written, files are sel-dom modified again. Small writes at arbitrary posi-tions in a file are supported but do not have to beefficient.
•
The system must efficiently implement well-defined se-mantics for multiple clients that concurrently appendto the same file. Our files are often used as producer-consumer queues or for many-way merging. Hundredsof producers, running one per machine, will concur-rently append to a file. Atomicity with minimal syn-chronization overhead is essential. The file may beread later, or a consumer may be reading through thefile simultaneously.
•
High sustained bandwidth is more important than lowlatency. Most of our target applications place a pre-mium on processing data in bulk at a high rate, whilefew have stringent response time requirements for anindividual read or write.
2.2 Interface
GFS provides a familiar file system interface, though itdoes not implement a standard API such as POSIX.Files areorganized hierarchically in directories and identified by path-names. We support the usual operations to
create
,
delete
,
open
,
close
,
read
, and
write
files.Moreover, GFS has
snapshot
and
record append
opera-tions. Snapshot creates a copy of a file or a directory treeat low cost. Record append allows multiple clients to ap-pend data to the same file concurrently while guaranteeingthe atomicity of each individual client’s append. It is use-ful for implementing multi-way merge results and producer-consumer queues that many clients can simultaneously ap-pend to without additional locking. We have found thesetypes of files to be invaluable in building large distributedapplications. Snapshot and record append are discussed fur-ther in Sections 3.4 and 3.3 respectively.
2.3 Architecture
A GFS cluster consists of a single
master
and multiple
chunkservers
and is accessed by multiple
clients
, as shownin Figure 1. Each of these is typically a commodity Linuxmachine running a user-level server process. It is easy to runboth a chunkserver and a client on the same machine, as longas machine resources permit and the lower reliability causedby running possibly flaky application code is acceptable.Files are divided into fixed-size
chunks
. Each chunk isidentified by an immutable and globally unique 64 bit
chunk handle
assigned by the master at the time of chunk creation.Chunkservers store chunks on local disks as Linux files andread or write chunk data specified by a chunk handle andbyte range. For reliability, each chunk is replicated on multi-ple chunkservers. By default, we store three replicas, thoughusers can designate different replication levels for differentregions of the file namespace.The master maintains all file system metadata. This in-cludes the namespace, access control information, the map-ping from files to chunks, and thecurrent locations of chunks.It also controls system-wide activities such as chunk leasemanagement, garbage collection of orphaned chunks, andchunk migration between chunkservers. The master peri-odically communicates with each chunkserver in
HeartBeat
messages to give it instructions and collect its state.GFS client code linked into each application implementsthe file system API and communicates with the master andchunkservers to read or write data on behalf of the applica-tion. Clients interact with the master for metadata opera-tions, but all data-bearing communication goes directly tothe chunkservers. We do not provide the POSIX API andtherefore need not hook into the Linux vnode layer.Neither the client nor the chunkserver caches file data.Client caches offer little benefit because most applicationsstream through huge files or have working sets too largeto be cached. Not having them simplifies the client andthe overall system by eliminating cache coherence issues.(Clients do cache metadata, however.) Chunkservers neednot cache file data because chunks are stored as local filesand so Linux’s buffer cache already keeps frequently accesseddata in memory.
2.4 Single Master
Having a single master vastly simplifies our design andenables the master to make sophisticated chunk placement
Leave a Comment