We propose new adaptive runtime techniques for MapReduce that improve performance and simplify job tuning. We implement these techniques by breaking a key assumption of MapReduce that mappers run in isolation. Instead, our mappers communicate through a distributed meta-data store and are aware of the global state of the job. However, we still preserve the fault-tolerance, scalability, and programming API of MapReduce. We utilize these situation-aware mappers to develop a set of techniques that make MapReduce more dynamic: (a) Adaptive Mappers dynamically take multiple data partitions (splits) to amortize mapper start-up costs; (b) Adaptive Combiners improve local aggregation by maintaining a cache of partial aggregates for the frequent keys; (c) Adaptive Sampling and Partitioning sample the mapper outputs and use the obtained statistics to produce balanced partitions for the reducers. Our experimental evaluation shows that adaptive techniques provide up to 3x performance improvement, in some cases, and dramatically improve performance stability across the board.
11. Situation-Aware Mappers
Main idea
Make MapReduce more dynamic
Mappers:
Aware of the global state of the job
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 9 / 25
12. Situation-Aware Mappers
Main idea
Make MapReduce more dynamic
Mappers:
Aware of the global state of the job
Communicate through a distributed meta-data store
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 9 / 25
13. Situation-Aware Mappers
Main idea
Make MapReduce more dynamic
Mappers:
Aware of the global state of the job
Communicate through a distributed meta-data store
Break assumption: isolation
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 9 / 25
14. Situation-Aware Mappers
Main idea
Make MapReduce more dynamic
Mappers:
Aware of the global state of the job
Communicate through a distributed meta-data store
Break assumption: isolation
Situation-Aware Mappers
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 9 / 25
29. Adaptive Mappers Experiments - Set-Similarity Join
1000
Regular Mappers Stage 3:
Adaptive Mappers
800 One-Phase Record Join
Time (seconds)
Broadcast join equivalent
600
DBLP and CITESEERX ×10
400 Single wave of AM
200
×3 speedup over default
0 Hadoop split size (64MB)
Optimal with no tuning
20
10
51
25
12
64
32
AM
48
24
2
6
8
Split Size (MB)
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 17 / 25
30. Adaptive Mappers Experiments - JOIN
Regular Mappers
Map-only job
1200
Adaptive Mappers 1B TERASORT records
Time (seconds)
900 Models a skewed join
Single wave of AM
600
Regular Mappers:
300 Large split: data skew
Small split: scheduling
0 and start-up overhead
Optimal with no tuning
10
51
25
12
64
32
16
8
AM
24
2
6
8
Split Size (MB)
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 18 / 25
31. Adaptive MapReduce
DMDS
DFS DFS
MAP
AM
AC
AP
AS
MAP REDUCE
AM
AC
AP
AS
MAP REDUCE
AM
AC
AP
AS
Adaptive Techniques
AM: Adaptive Mappers
AC: Adaptive Combiners
AS: Adaptive Sampling
AP: Adaptive Partitioning
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 19 / 25
32. Adaptive Combiners
Main idea
Replace sort with hashing
Reduce serialization, sort, and IO
Regular Combiners
Sort Buffer
Map
: User code
: Data
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 20 / 25
33. Adaptive Combiners
Main idea
Replace sort with hashing
Reduce serialization, sort, and IO
Regular Combiners
Sort Buffer
Map Sort Combine
: User code
: Data
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 20 / 25
34. Adaptive Combiners
Main idea
Replace sort with hashing
Reduce serialization, sort, and IO
Regular Combiners
Sort Buffer
Map Sort Combine
: User code
: Data
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 20 / 25
35. Adaptive Combiners
Main idea
Replace sort with hashing
Reduce serialization, sort, and IO
Regular Combiners
Sort Buffer
Map Sort Combine Merge
: User code
: Data
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 20 / 25
36. Adaptive Combiners
Main idea
Replace sort with hashing
Reduce serialization, sort, and IO
Regular Combiners
Sort Buffer
Map Sort Combine Merge
: User code
Adaptive Combiners : Data
Hash-group and Combine
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 20 / 25
37. Adaptive Combiners
Main idea
Replace sort with hashing
Reduce serialization, sort, and IO
Regular Combiners
Sort Buffer
Map Sort Combine Merge
: User code
Adaptive Combiners : Data
Hash-group and Combine
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 20 / 25
38. Adaptive Combiners Details
“Best-effort” aggregation
Never spill to disk
Hash-table replacement policies:
No-Replacement (NR)
Least-Recently-Used (LRU)
Implemented as:
Library for Hadoop
Optimization choice for Jaql
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 21 / 25
39. Adaptive Combiners Experiments
GROUP-BY
Synthetic dataset with 3 dimensions (A1, A2, and A3) and 1 fact
Group records and apply aggregation function
TWL: 10B records, 120GB
180 350 1.00
300
150
Time (seconds)
0.75
Miss Ratio (%)
Time (seconds)
250
120 200
0.50
90 150
100 0.25
60
50
30
0 0.00
Re
AM
1
25
10
0
0
g.
Re
AM
AC
AM
Cache Size (K)
g.
,A
C
Regular Combiners
Adaptive Combiners NR
Regular Combiners Adaptive Combiners LRU
Adaptive Combiners NR Miss Ratio NR
Adaptive Combiners LRU Miss Ratio LRU
GROUP-BY on A1 GROUP-BY on A1 and A2
×2.5 speedup ×3 speedup
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 22 / 25
40. Adaptive MapReduce
DMDS
DFS DFS
MAP
AM
AC
AP
AS
MAP REDUCE
AM
AC
AP
AS
MAP REDUCE
AM
AC
AP
AS
Adaptive Techniques
AM: Adaptive Mappers
AC: Adaptive Combiners
AS: Adaptive Sampling
AP: Adaptive Partitioning
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 23 / 25
42. Adaptive Sampling and Partitioning
DMDS
Step 1 Compute and publish
local histogram MAP
REDUCE
MAP
REDUCE
MAP
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 24 / 25
43. Adaptive Sampling and Partitioning
DMDS
Step 1 Compute and publish
local histogram MAP
Step 2 Collect local
histograms and REDUCE
compute partitioning
function MAP
REDUCE
MAP
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 24 / 25
44. Adaptive Sampling and Partitioning
DMDS
Step 1 Compute and publish
local histogram MAP
Step 2 Collect local
histograms and REDUCE
compute partitioning
function MAP
Step 3 Broadcast partitioning
function
REDUCE
MAP
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 24 / 25
45. Summary
Adaptive runtime techniques for MapReduce
Situation-Aware Mappers
Make MapReduce more dynamic
Up to ×3 speedup for well-tuned jobs
Orders of magnitude speedup for badly tuned jobs
Never hurt performance
Configure themselves
Part of IBM InfoSphere BigInsights
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 25 / 25
46. Vernica, R., Carey, M., and Li, C. (2010).
Efficient parallel set-similarity joins using MapReduce.
In SIGMOD Conference.
Rares Vernica (HP Labs) Adaptive MapReduce EDBT 2012 25 / 25