Automatic optimization of MapReduce Programs

Published  . 0 views
↓ Download
Automatic optimization of MapReduce Programs
1 / 1
Automatic optimization of MapReduce Programs - slide 1 of 30 Automatic optimization of MapReduce Programs - slide 2 of 30 Automatic optimization of MapReduce Programs - slide 3 of 30 Automatic optimization of MapReduce Programs - slide 4 of 30 Automatic optimization of MapReduce Programs - slide 5 of 30 Automatic optimization of MapReduce Programs - slide 6 of 30 Automatic optimization of MapReduce Programs - slide 7 of 30 Automatic optimization of MapReduce Programs - slide 8 of 30 Automatic optimization of MapReduce Programs - slide 9 of 30 Automatic optimization of MapReduce Programs - slide 10 of 30 Automatic optimization of MapReduce Programs - slide 11 of 30 Automatic optimization of MapReduce Programs - slide 12 of 30 Automatic optimization of MapReduce Programs - slide 13 of 30 Automatic optimization of MapReduce Programs - slide 14 of 30 Automatic optimization of MapReduce Programs - slide 15 of 30 Automatic optimization of MapReduce Programs - slide 16 of 30 Automatic optimization of MapReduce Programs - slide 17 of 30 Automatic optimization of MapReduce Programs - slide 18 of 30 Automatic optimization of MapReduce Programs - slide 19 of 30 Automatic optimization of MapReduce Programs - slide 20 of 30 Automatic optimization of MapReduce Programs - slide 21 of 30 Automatic optimization of MapReduce Programs - slide 22 of 30 Automatic optimization of MapReduce Programs - slide 23 of 30 Automatic optimization of MapReduce Programs - slide 24 of 30 Automatic optimization of MapReduce Programs - slide 25 of 30 Automatic optimization of MapReduce Programs - slide 26 of 30 Automatic optimization of MapReduce Programs - slide 27 of 30 Automatic optimization of MapReduce Programs - slide 28 of 30 Automatic optimization of MapReduce Programs - slide 29 of 30 Automatic optimization of MapReduce Programs - slide 30 of 30
Description: Automatic optimization of MapReduce Programs Michael Cafarella, Eaman Jahani, Christopher Re August 2011 MapReduce is victorious Google statistics: Hadoop statistics: 7 PB Vertica clusters vs. 22 PB Cloudera Hadoop clusters1 1. Omer

Related Topics

Download Presentation

"Automatic optimization of MapReduce Programs" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentation Transcript

slide1. Automatic optimization of MapReduce Programs Michael Cafarella, Eaman Jahani, Christopher Re August 2011<br>
slide2. MapReduce is victorious Google statistics:

Hadoop statistics:
7 PB+ Vertica clusters vs. 22 PB+ Cloudera Hadoop clusters1 1. Omer Trajman, Cloudera VP, http://www.dbms2.com/<br>
slide3. MapReduce in relational land Designers original Intention: free-formed data
web-scale indexing/log processing

But, many relational workloads1
Complex queries/data analysis

Caveat: MR performance lags RDBMS performance Karmasphere corporation: A study of hadoop developers, http://karmasphere.com, 2010<br>
slide4. Pavlo et al., A Comparison of Approaches to Large-Scale Data Analysis, SIGMOD 2009 Selection is Slower with MapReduce<br>
slide5. Pavlo et al., A Comparison of Approaches to Large-Scale Data Analysis, SIGMOD 2009 Join is Even Slower<br>
slide6. MR Lags in Relational Land Stonebraker, Dewitt:
''MapReduce has no indexes and therefore has only brute force as a processing option. It will be creamed whenever an index is the better access mechanism.’’1

Query processing tasks
No metadata, semantics, indices
Free-formed input is a double-edged sword 1. MapReduce: a major step backwards, http://databasecolumn.vertica.com/, 2008<br>
slide7. Manimal Manimal is a hybrid system, combining MapReduce programming model and well-known execution techniques

Techniques today only found in RDBMS, but should be in MapReduce, too.<br>
slide8. Manimal Approach bytecode *.class optimization opportunities execution path void map(Text key, WebPage w) {
if(w.rank > 10)
emit(w.url,w.rank);
}

Challenges:
Safely detect query semantic optimization
How much performance gain? SELECTION from B+Tree index on W.RANK<br>
slide9. Manimal Contributions Our Manimal system:
Detect safe relational optimizations in users’ compiled MapReduce programs

Our results:
Runs with unmodified MapReduce code
Runs up to 11x faster on same code
Provides framework for more optimizations<br>
slide10. Outline Introduction
Execution Framework
Optimization/Analyzer Examples
Experiments
Analyzer recall
Performance gain
Related Work and Conclusion<br>
slide11. Execution framework public void map(Text key, WebPage w, OutputCollector<Text, LongWritable> out) {
if(w.rank > 10)
emit(w.url, w.rank);
}<br>
slide12. Execution Framework varload ‘value’
invokevirtual
astore ‘text’

ifeq … Analyzer Optimizer Execution<br>
slide13. 13 Execution Framework void map(k, w) {
out.set(indexedOutputFormat);
emit(w.rank, (k,w)) } (SELECT f, w.rank>10) Analyzer in: user program
Analyzer out: optimization descriptor
index-generation program varload ‘value’
invokevirtual
astore ‘text’

ifeq … Analyzer Optimizer Execution<br>
slide14. 14 Execution Framework Optimizer in: optimization descriptor
catalog
Optimizer out: execution descriptor (SELECT,“log.1.idx”, w.rank>10) varload ‘value’
invokevirtual
astore ‘text’

ifeq … Analyzer Optimizer Execution (SELECT f, w.rank>10)<br>
slide15. 15 Execution Framework numwords 19519 (SELECT,“log.1.idx”, w.rank>10) varload ‘value’
invokevirtual
astore ‘text’

ifeq … Analyzer Optimizer Execution Execution in: execution descriptor
user program
Execution out: program output<br>
slide16. Outline Introduction
Execution Framework
Optimization/Analyzer Examples
Experiments
Analyzer recall
Performance gain
Related Work and Conclusion<br>
slide17. An Optimization Example //webpage.java: SCHEMA!
Class WebPage {String URL,int rank,String content}

//mapper.java
void map(Text key, WebPage w) {
if (w.url==‘teaparty.fr’)
emit(w.url, 1);
}

Data-centric programming idioms == relational ops PROJECTED view: (url,null,null)
DIRECT-OP on compressed Webpage<br>
slide18. Semantic Extraction Query semantic are obvious to human readers, but not explicit in the code for framework

EXTRACT IT!
Static code analysis
Control-flow graph and data-flow graph
Find opportunities: selection, projection, direct op
Safe optimizations: same output<br>
slide19. Analyzer: An Example //webpage.java
Class WebPage {String URL,int rank,String content}

//mapper.java
map(Text key,Webpage w) {
if (w.rank > 10)
emit(w.url,w.rank);
} Fn Entry w.rank > 10 Fn Exit Analyzer emit(url,rank)<br>
slide20. Current Optimizations B+-Tree for Selections
Projected views
Delta compression on numerics
Direct operation of compressed data

Hadoop compression is not semantic aware<br>
slide21. Outline Introduction
Execution Framework
Optimization/Analyzer Examples
Experiments
Analyzer recall
Performance gain
Related Work and Conclusion<br>
slide22. Experiments: Analyzer Test MapReduce programs from Pavlo, SIGMOD ‘09:
Detected 5 out of 8 opportunities:
Two misses due to custom serialization class
Another miss requires knowledge of java.util.Hashtable semantics<br>
slide23. Experiments: Performance Optimize four Web page handling tasks:
Selection (filtering)
Projection (aggregation on subfield of page)
Join (pages to user visits)
User Defined Functions (aggregation)

5 cluster nodes, 123GB of data<br>
slide24. Experiments: Performance<br>
slide25. Experiments: Performance<br>
slide26. Experiments: Performance Up to 11x speedup over original Hadoop
Performance comparable to DBMS-X from Pavlo
UDF not detected: running time identical<br>
slide27. Outline Introduction
Execution Framework
Optimization/Analyzer Examples
Experiments
Analyzer recall
Performance gain
Related Work and Conclusion<br>
slide28. Related Work Lots of recent MapReduce activity
Quincy: Task scheduling (Isard et al, SOSP, 2009)
HadoopDB (Abouzeid et al, PVLDB 2009)
Hadoop++ (Dittrich et al, PVLDB 2010)
HaLoop (Bu et al, PVLDB 2010)
Twister (Ekanayake et al, HPDC 2010)
Starfish (Herodotou et al, CIDR 2011)

Manimal does not introduce new optimizations. It detects and applies existing optimizations to code<br>
slide29. Lessons Learned The Good: We can recognize data processing idioms in real code. Relational operations still exist even in NoSQL world

The Ugly: When we started this project in 2009, we underestimated interest in writing in higher level languages (e.g., Pig Latin)<br>
slide30. Conclusion Manimal provides framework for applying well-known optimization techniques to MapReduce
Automatic optimization of user code
Up to 11x speed increase
Provides framework for more optimizations<br>