- 2074 Bhadra · 4 marks
Optimization and data locality in MapReduce
Short answer
Data locality moves computation to the data, preferring data-local then rack-local execution. HDFS block replication on three nodes enables local choices. Optimization techniques include combiners, specutive execution, compression, and custom partitioning.
What is Optimization and Data Locality in Map Reduce?
Data locality
Data locality means moving the computation to the data instead of moving the data to the computation. In a big data cluster the network bandwidth is scarce, while moving a small program is cheap. So the MapReduce scheduler tries to run each map task on the node that stores the input block.
Levels of locality, in order of preference:
- Data-local: the map task runs on the same node as its block.
- Rack-local: the same rack, but a different node (data passes via the rack switch).
- Off-rack: a different rack (most expensive).
HDFS replicates each block on 3 nodes, which gives the scheduler more choices for local execution.
Optimization in MapReduce
Techniques used to make jobs faster and reduce network and disk use:
- Combiner: local aggregation of map output to reduce shuffle data.
- Data locality scheduling: as above.
- Speculative execution: a slow-running task (straggler) is run again on another node and the first to finish is used.
- Compression of map output and final output to cut I/O and network traffic.
- Proper number of mappers/reducers and block size for balance; avoid many small files (use CombineFileInputFormat).
- Custom partitioner to avoid skew so that reducers get equal loads.
- In-memory buffer tuning (e.g.
io.sort.mb) to reduce spills to disk. - JVM reuse to reduce task start-up cost.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- MapReduce data flow technique · Big Data Technologies, chapter 3
- MapReduce worker failure tolerance · Big Data Technologies, chapter 3
- MapReduce workflow with example · Big Data Technologies, chapter 3 · asked 2×
- MapReduce max marks per college · Big Data Technologies, chapter 3
- Combiner function in MapReduce · Big Data Technologies, chapter 3
- Max and min word occurrence with MapReduce · Big Data Technologies, chapter 3
- MapReduce working with example · Information System, chapter 8
- MapReduce vs Hadoop; IR process · Information System, chapter 8
- MapReduce with GFS and HDFS · Information System, chapter 8
- DAD curve procedure and isohyetal area data · Engineering Hydrology, chapter 2