Download presentation
Published byEgbert Owens Modified over 9 years ago
1
MapReduce: Simplified Data Processing on Large Clusters
Jeffrey Dean and Sanjay Ghemawat Google, Inc. Presented by Saleh Alnaeli At Kent State University Fall 2010 Advance Database systems course. Prof. Ruoming Jin.
2
Goals Introduction Programming Model Implementation & model features
Refinements Performance Evaluation Conclusion
3
What is Map-Reduce? Programming Model, approach, for processing large data sets. Contains Map and Reduce functions. Runs on a large cluster of commodity machines. Many real world tasks are expressible in this model.
4
Programming model Input & Output are sets of key/value pairs
Programmer specifies two functions: map (in_key, in_value) -> list(out_key, intermediate_value) reduce (out_key, list(intermediate_value)) -> list(out_value) Combines all intermediate values for a particular key Produces a set of merged output values (usually just one)
5
Example1 : count words in docs
Input consists of (url, contents) pairs map(key=url, val=contents): For each word w in contents, emit (w, “1”) reduce(key=word, values=uniq_counts): Sum all “1”s in values list Emit result “(word, sum)”
6
Example1: Cont. map(key=url, val=contents):
For each word w in contents, emit (w, “1”) reduce(key=word, values=uniq_counts): Sum all “1”s in values list Emit result “(word, sum)” Jin 1 Is doing well 1 Is 1 Active 1 Doc1: Jin is doing well Active 1 doing Is 2 Jin 2 well 1 MAP Reduce Doc2: Jin is active
7
Model is Widely Applicable MapReduce Programs In Google Source Tree
More Example distributed grep (later) distributed sort (later) Reverse web link-graph term-vector / host URL access frequency inverted index And many …….
8
Implementation Many different implementations are possible
The right choice is depending on the environment. Typical cluster: (wide use at Google, large clusters of PC’s connected via switched nets) Hundreds to thousands of dual-processors x86 machines, Linux, 2-4 GB of memory per machine. connected with networking HW, Limited bisection bandwidth Storage is on local IDE disks (inexpensive) GFS: distributed file system manages data Scheduling system by the users to submit the tasks (Job=set of tasks mapped by scheduler to set of available PC within the cluster) Implemented using C++ library and linked into user programs
9
Execution Overview Map and reduce invocations are distributed across multiple PC’s as follows: Partition input key/value pairs into M chunks, run map() tasks in parallel After map()’s are complete, merge all emitted values for each emitted intermediate key then partition space of output map keys into R pieces( user), and run reduce() in parallel. If map() or reduce() fails, fault tolerance technique is used, coming in next slides.
10
The master pings every worker periodically (no response -> worker marked as failed)
Maser keeps several data structures for each map and reduce task. (State, worker Id) Execution Overview
11
Execution set of intermediate key/value pairs
merges all intermediate values associated with the same intermediate key.
12
Parallel Execution
13
Fault Tolerance Works: Handled through re-execution Master failure:
Detect failure via periodic heartbeats Re-execute completed + in-progress map tasks Why do we need to re-execute even the completed tasks? Re-execute in progress reduce tasks Task completion committed through master Master failure: It can be handled, but don't yet (master failure unlikely)
14
Locality Master scheduling policy: As a result:
Asks GFS for locations of replicas of input file blocks Map tasks typically split into 64MB (GFS block size) Map tasks scheduled so GFS input block replica are on same machine or same rack As a result: most task’s input data is read locally and consumes no network bandwidth
15
Backup Tasks common causes that lengthens the total time taken for a MapReduce operation is a straggler. mechanism to alleviate the problem of stragglers. the master schedules backup executions of the remaining in-progress tasks. significantly reduces the time to complete large MapReduce operations.( up to 40% )
16
Refinement Different partitioning functions. Combiner function.
User specify the number of reduce tasks/output that they desire (R). Combiner function. Useful for saving network bandwidth Different input/output types. Skipping bad records. Master asks next worker is told to skip the bad record Local execution. an alternative implementation of the MapReduce library that sequentially executes all of the work for a MapReduce operation on the local machine. Status info. Progress of the computation & more info… Counters. count occurrences of various events. (Ex: total number of words processed)
17
Performance measure the performance of MapReduce on two computations running on a large cluster of machines. MR_GrepScan searches through approximately one terabyte of data looking for a particular pattern MR_Sort sorts approximately one terabyte of data
18
Performance Cont. Tests run on : Specifications Cluster 1800 machines
Memory 4 GB Processors Dual-processor 2 GHz Xeons with Hyper-threading Hard disk Dual 160 GB IDE disks Network Gigabit Ethernet per machine bandwidth approximately 100 Gbps
19
Data Transfer rate over time
MR_Grep Scans 10 billions 100-byte records, searching for rare 3-character pattern (occurs in 92,337 records). input is split into approximately 64MB pieces (M = 15000), entire output is placed in one file , R = 1 Startup overhead is significant for short jobs
20
MR_Sort Backup tasks improves completion time reasonably
System manages machine failures relatively quickly.
21
Experience & Conclusions
More and more use of MapReduce approach. See the paper. MapReduce has proven to be a useful abstraction Greatly simplifies large-scale computations at Google Fun to use: focus on problem, let library deal with messy details No big need for parallelization knowledge (relief the user from dealing with low level parallelization details)
22
Disadvantages Might be hard to express problem in MapReduce
Data parallelism is key Need to be able to break up a problem by data chunks MapReduce is closed-source (to Google) C++ Hadoop is open-source Java-based rewrite
23
Related Work HadoopDB: (An Architectural Hybrid of MapReduce and DBMS Technologies for Analytical Workloads) [R4] a hybrid system that takes the best features from both technologies; the prototype approaches parallel databases in performance and efficiency, yet still yields the scalability, fault tolerance, and flexibility of MapReduce-based systems. FREERIDE (Framework for Rapid Implementation of Datamining Engines). [R3] a middleware for rapid development of data mining implementations on large SMPs and clusters of SMPs. The middleware performs distributed memory parallelization across the cluster and shared memory parallelization within each node. River (processes communicate with each other by sending data over distributed queues / similar in Dynamic load balancing) [R5]
24
References J. Dean and S. Ghemawat. Dan Weld’s at U. Washington
MapReduce: Simplified Data Processing on Large Clusters. In OSDI, (Paper and slides) Dan Weld’s at U. Washington (tutorial & slides) Ruoming Jin, Ge Yang, and Gagan Agrawal Shared Memory Parallelization of Data Mining Algorithms: Techniques, Programming Interface, and Performance (pdf 2004) [R3] Azza Abouzeid, Kamil BajdaPawlikowski,Daniel Abadi, Avi Silberschatz, Alexander Rasin HadoopDB: An Architectural Hybrid of MapReduce and DBMS Technologies for Analytical Workloads [R4] Remzi H. Arpaci-Dusseau, Eric Anderson, Noah Treuhaft, David E. Culler, Joseph M. Hellerstein, David Patterson, and Kathy Yelick. Cluster I/O with River: Making the fast case common. In Proceedings of the Sixth Workshop on Input/Output in Parallel and DistributedSystems (IOPADS '99), pages 10.22, Atlanta, Georgia, May [R4] Prof.Demmel inst.eecs.berkeley.edu/~cs61c
25
Thank you! Questions and Comments?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.