1 / 45

A Platform for Scalable One-pass Analytics using MapReduce

A Platform for Scalable One-pass Analytics using MapReduce. Karim Ibrahim Anh Pham. Outline. Motivation & Introduction Benchmarking study Optimizing Hadoop. Motivation. Motivation ( cont ’). Motivation : MapReduce model is not well suited for one pass analytics.

jun
Download Presentation

A Platform for Scalable One-pass Analytics using MapReduce

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Platform for Scalable One-pass Analytics using MapReduce Karim Ibrahim Anh Pham

  2. Outline • Motivation & Introduction • Benchmarking study • Optimizing Hadoop

  3. Motivation

  4. Motivation (cont’) • Motivation: • MapReduce model is not well suited for one pass analytics. • MapReduce is geared towards batch processing. • Merge-sort implementation for partitioning and parallel processing act as a barrier in the incremental one-pass processing. • Proposed: • New data analysis platform , employs hashing techniques to enable fast in-memory processing. • New frequent key based technique to extend processing to workload that require a large key state space.

  5. Introduction • MapReduce implementation require the entire data set to be loaded into the cluster before running analytical queries. • In the new model, the MapReduce system : • reads input data only once, • performs incremental processing as more data is read, • utilizes system resources efficiently to achieve high performance and scalability.

  6. Supporting incremental one-pass analytics • We need to avoid: • Blocking operations . • Computational and I/O bottlenecks that prevent data from flowing through map and reduce phases on the processing pipeline. • From a performance standpoint, we need: • Perform fast in-memory processing of a MapReduce query program for all of the data.

  7. Outline • Motivation & Introduction • Benchmarking study • Optimizing Hadoop

  8. Benchmarking Study • Evaluate platforms : • Hadoop • MapReduce Online • MapReduceOnline’s pipelining only redistributes workloads between the map and reduce tasks. • Results reveal that: • In both systems, mechanism for parallel processing , based on a sort-merge technique causes CPU & I/O bottlenecks & blocking. • MapReduce Online is not effective for reducing blocking or I/O overhead.

  9. In-depth Analysis of Hadoop • Goal: • whether the previous performance limitations are inherent to Hadoop or • whether tuning of key system parameters can overcome these drawbacks • Analytical model can be used to choose appropriate values of Hadoop parameters, thereby reducing I/O and startup costs.

  10. Proposed mechanisms for MapReduce • Replaces the sort-merge implementation in MapReduce with a purely hash-based framework. • Hash techniques enable fast in-memory processing of the reduce function when the memory reaches a sufficient size as determined by the workload and algorithm • Propose an efficient technique to identify frequent keys ,update their states using a full in-memory processing path, both saving I/Os and enabling early answers for these keys.

  11. Hadoop Characteristics • For parallel processing, Hadoop uses block-level scheduling and a sort-merge technique. • Sorted map output is written to disk for fault tolerance. • After a mapper completes and so map output data is available in the mapper’s memory. • As reducer’s buffer fills up, these sorted pieces of data are merged and written to a file on disk.

  12. MapReduce Online characteristics • HOP (Hadoop online Prototype) has two unique features : • Each mapper produces output, it can push data eagerly to the reducers, with the granularity of transmission controlled by a parameter. • Adaptive mechanism is used to balance the work between the mappers and reducers.

  13. Proposed system Vs. Hadoop • Sessionization Example: • click stream, the reducers output user sessions as data is read and finish as soon as all mappers finish reading the data in 34.5 minutes, triggering only 0.1 GB internal data spill to disk in the job. • the original Hadoop system returns all the results towards the end of the 81 minute job, writing 370GB internal data spill to disk

  14. Hadoop Analysis

  15. Hadoop Analysis • To reduce disk contention, we used additional hardware so that the disk handled • only the input and output with HDFS, and • all the intermediate data was passed to a fast SSD (Solid state drive). • Reduce the overall running time, yet the overhead of sorting becomes more dominant in the overall cost.

  16. MapReduce online • pipelining does not reduce the total sort-merge cost but only rebalances the work between the mappers and reducers

  17. Evaluation summary • The sorting step of sort-merge incurs high CPU cost. • Multi-pass merge in sort-merge is blocking and can incur high I/O cost given the intermediate data. • Using extra storage devices does not eliminate blocking & I/O bottleneck. • The Hadoop Online Prototype with pipelining does not eliminate blocking, I/O & CPU bottlenecks Violation of incremental processing or fast in-memory processing

  18. Outline • Motivation & Introduction • Benchmarking study • Optimizing Hadoop

  19. Optimizing Hadoop • Goal: understand whether • the performance issues identified by our benchmarking study are inherent to Hadoop or • whether they can be overcome by appropriate tuning of key system parameters • Assumptions : • The MapReduce job under consideration does not use a combine function. • Each reducer processes an equal number of < key, value > pairs. • Finally, when a reducer pulls a mapper for data, the mapper has just finished so its output can be read directly from its local memory.

  20. Symbols used in Hadoop analysis

  21. Analytical model for Hadoop:Modeling I/O Cost in Bytes • The analysis includes five I/O-types listed in Table 2. • Each map task reads a data chunk of size C as input, and writes C . Km bytes as output. • Given the workload D , we have D / C map tasks in total and D / ( C . N ) map tasks per node. So, the input cost, U1, and output cost, U3 , of all map tasks on a node are: • The size of the reduce output on each node is

  22. Modeling the Number of I/O requests • Involved than the analysis above due to the need to consider memory allocation. • The I/O cost is dominated by the cost of reading and writing all the bytes, not the seek time

  23. Modeling the Startup Cost • Since the number of map tasks is usually much larger than reduce tasks, we consider the startup cost for map tasks. If cm is the cost in second of creating a map task, the total map startup cost per node is cstart .D / CN

  24. Optimizing Hadoop based on the Model • Compare the predicted system behavior based on our model and the actual running time measured in our Hadoop cluster. • We used the sessionization task and configured the workload, our cluster, and Hadoop as follows: • Workload: D=97GB, Km= Kr=1; • Hardware: N =10, Bm=140MB, Br =260MB; • Hadoop: reduce=4 or 8, and varied values of C and F • Under 100 different combinations of ( C , F )

  25. Optimizing Hadoop based on the Model • Optimizing Chunk Size • Chunk size C is very small, MapReduce job uses many map tasks and the map startup cost dominates. • As C increases, the map startup cost reduces, till the map output exceeds buffer size, multi-pass merge is incurred with increased I/O cost. • Optimizing the Merge Factor • F controls how frequently on-disk files are merged in the multi-pass merge phase. • a smaller F value incurs more I/O bytes, but fewer disk seeks. Benefits of small F values is shown only when the system is given limited memory but a very large data set • Effect of the Number of Reducers • For R =8, the reducers are started in two waves

  26. Optimizing Hadoop based on the Model • Map progress increases steadily and reaches 100% around 2,000 seconds. • The reduce progress increases to 33% in these 2,000 seconds, • Because the shuffle progress could keep up with the map progress. • Then the reduce progress slows down, due to the overhead of merging, and lags far behind the map progress

  27. Optimizing Hadoop based on the Model • The CPU utilization exhibits a smaller dip in the middle of a job compared to stock Hadoop . • the CPU overhead due to sorting, as mentioned in our benchmark, still exists. • The CPU iowait plot still shows a spike in the middle of job, due to the blocking of CPU by the I/O operations in the remaining single-pass merge.

  28. Optimizing Hadoop Summary • The proposed analytical model can be used to choose appropriate values of Hadoop parameters, thereby improving performance. • Optimized Hadoop still has a significant barrier to fast incremental processing: • The remaining one-pass merge can still incur blocking and a substantial I/O cost. • The reduce progress falls far behind the map progress. • The map tasks still have the high CPU cost of sorting. • Pipelining from mappers to reducers does not resolve the blocking and I/O overhead in Hadoop, and achieves only a small performance gain over stock Hadoop

  29. Outline • New hash-based platform • MR-hash • INC-hash • DINC-hash • Prototype Implementation • Performance evaluation

  30. Basic hash (MR-hash) • Enables fast in-memory processing when there is sufficient memory for the current workload • Avoids the CPU cost of sorting. • Allows early answers to be returned for the buffered bucket, D1, as data comes to the reducer. • h2 can be designed so that D1 • contains only important keys D1 A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  31. Incremental hash (INC-hash) • Designed for reduce functions that permit incremental processing • init(): reduces a sequence of data items to a state • cb(): reduces a sequence of states to a state • fn():produces a final answer from a state H A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  32. Incremental hash (INC-hash) In-memory hash table H New tuple (key, state) arrives; if key in H cb() kicks in, state updated; If key not in H if have free space add new tuple; else h3(new tuple); - Query answers can be derived as soon as the relevant data is available, e.g., when the count in a group exceeds a query-specified threshold - IO can be eliminated if memory is large enough to hold all the distinct keys H A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  33. Dynamic Incremental hash (DINC-hash) • Determine which keys should be processed in memory and which keys will be written to disk. • Recognize hot keys that appear frequently in the data set and hold their states in memory => Providing incremental in-memory processing for these keys: Greater I/O efficiency A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  34. s: maximum number of in-memory tuples (key-state) Counters: c[1]… c[s] Keys: k[1]... k[s] (being monitored) State: S[1]… S[s] (k,v) arrives; If k is being monitored: c++; S updated; If k is not being monitored: if c == 0 existed set k; set S = v; c = 1; if all c > 0 c--; write (k, v) to disk; A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  35. Outline • New hash-based platform • MR-hash • INC-hash • DINC-hash • Prototype Implementation • Performance evaluation

  36. Prototype Implementation Hash-based Map Output: replace MapOutputBuffer component with a new Hash-based Map Output component. Sort-merge phase is elimilated. HashThread: InMemFSMerge performs in-memory and on-disk merges and writes data to disk whenever the shuffle buffer is full. Replaced by HashThread - provides a user-configurable option to choose between MR-hash, INC-hash, and DINC-hash. A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  37. Outline • New hash-based platform • MR-hash • INC-hash • DINC-hash • Prototype Implementation • Performance evaluation

  38. Performance evaluation • 236GB data of WorldCupclick stream • (1) Sessionization: Split the click stream of each user into sessions. • (2) User click counting: count the number of clicks made by each user. • (3) Frequent user identification: Find users who click at least 50 times. • 156GB data of GOV2 dataset • (4) Trigram counting: Report word trigrams that appear more than 1000 times A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  39. Small Key-state Space The distinct key-state pairs fit in memory or slightly exceed the memory size. A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  40. A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  41. A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  42. Large Key-state Space Memory can hold fewer states and that the reduce performance can be hurted due to IO overheads A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  43. Hot key-state pairs are held and processed in the memory, and can be directly output => Dramatically reduce the spill data size A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  44. the trigram data is evenly distributed => so most hot trigrams appear before the reduce memory fills up. INC-hash naturally holds them in memory => no performance advantage for DINC-hash technique. A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

  45. - New hash techniques runs faster due to the elimination of sorting. - For workloads that has a small key-state space, INC-hash performs fully in-memory incremental processing, and its reducer progress can keep up with the map progress for queries that allows early output and generates less spill data. - For workloads that require a large key-state space, DINC-hash helps to significantly reduce I/Os and enable the reduce progress to keep up with the map progress, thereby realizing incremental processing A Platform for Scalable One-Pass Analytics using MapReduce, SIGMOD 11

More Related