M3R: Increased performance for in-memory Hadoop jobs

Avraham Shinnar, David Cunningham, Benjamin Herta, Vijay A. Saraswat

Introduction

The Apache Hadoop MapReduce (HMR) framework was originally engineered for an era characterized by massive datasets exceeding RAM capacity and clusters composed of failure-prone commodity hardware. Consequently, Hadoop prioritizes extreme resilience, frequently writing intermediate data to disk and employing a heavy-duty "JobTracker" for task monitoring.

However, modern "Big Data" workloads—particularly iterative machine learning and interactive analytics—often involve datasets that fit within the aggregate memory of a cluster. In these scenarios, Hadoop’s design choices become bottlenecks. The overhead of spawning Java Virtual Machines (JVMs), constant heartbeating, and disk-based data shuffling results in significant performance gaps. M3R (Main Memory Map Reduce) addresses this by providing a high-performance execution engine that maintains Hadoop API compatibility while running entirely in memory.

System Architecture

M3R is a ground-up reimplementation of the Hadoop API written in X10, a language optimized for high-performance parallel computing. Unlike standard Hadoop, M3R utilizes several key architectural innovations to minimize latency:

  • Persistent Worker Processes: Instead of spawning new JVMs for every task, M3R uses long-lived worker processes ("places"), eliminating startup overhead.
  • In-Memory Key/Value Cache: M3R intercepts file system calls to keep intermediate data in a memory cache, bypassing HDFS serialization for subsequent jobs in a sequence.
  • Partition Stability: M3R ensures that specific data partitions are consistently assigned to the same physical nodes across jobs. This allows locality-aware algorithms to reuse data already present in local memory.
  • Lean Coordination: Slow heartbeat mechanisms are replaced with fast X10 synchronization primitives like barriers and teams.
M3R System Architecture

Evaluation and Results

The system was evaluated using benchmarks including sparse matrix-vector multiplication (SpMV), WordCount, and real-world machine learning scripts from IBM’s SystemML (e.g., Linear Regression, PageRank).

M3R demonstrated substantial performance gains:

  • Iterative Analytics: On SpMV, M3R achieved up to a 45x speedup over standard Hadoop. This is largely due to its ability to maintain "hot" data in memory across iterations.
  • Reduced Latency: Small jobs that typically take 10–20 seconds to initialize in Hadoop run almost instantaneously in M3R.
  • Baseline Efficiency: Even for non-iterative tasks like WordCount, M3R was approximately 2x faster by avoiding disk I/O and JVM startup costs.
Iterative MapReduce Workflow in M3R

Discussion and Conclusion

By sacrificing the extreme resilience of Hadoop—specifically the ability to recover individual failed tasks mid-job—M3R removes the checkpointing overhead that hinders performance. While M3R is strictly "in-core" and lacks the disk-fallback capabilities of Hadoop, it serves as a powerful "drop-in" replacement for existing Hadoop codebases requiring HPC-level speed.

Future work includes exploring "elasticity" to add or remove nodes dynamically and implementing lightweight resilience mechanisms that do not compromise the performance benefits of in-memory execution.

Summary updated

BibTeX
@article{shinnar2012m,
  author = {Avraham Shinnar and David Cunningham and Benjamin Herta and Vijay A. Saraswat},
  title = {{M3R: Increased performance for in-memory Hadoop jobs}},
  journal = {Proc. VLDB Endow.},
  year = {2012},
  doi = {10.14778/2367502.2367513},
}
Figure