MURS: Mitigating Memory Pressure in Service-Oriented Data Processing System

Xuanhua Shi, Xiong Zhang, Ligang He, Hai Jin, Zhixiang Ke, Song Wu

TL;DR

This paper tackles the critical issue of memory pressure in service-oriented data processing systems, where multiple tasks run concurrently. They introduce MURS, a novel scheduler that intelligently identifies and temporarily suspends "heavy" memory-consuming tasks, allowing "light" tasks to complete faster and significantly improving overall system performance and resource utilization.

What Problem Does This Paper Address?

In-memory data processing systems like Spark and Flink offer significant speedups by keeping data in RAM. However, this can lead to "memory pressure," where the system struggles to manage available memory, resulting in frequent garbage collection (GC) or even crashes. This problem is exacerbated in service-oriented deployments where multiple users submit tasks simultaneously, sharing resources. Unlike traditional batch processing where tasks run sequentially, in a service model, a single "heavy" task can negatively impact all other "light" tasks running concurrently, even if those light tasks would normally consume little memory. The core challenge is to manage this shared memory effectively to prevent performance degradation and system instability.

Methods

The authors propose a new scheduling mechanism called MURS (Memory Usage Rate based Scheduler). The core idea is to classify tasks based on their memory consumption patterns. They identify that the root cause of memory pressure stems from "long-living data objects" generated by API functions within the processing frameworks.

  1. Memory Usage Models: They define four coarse-grained models (constant, sub-linear, linear, super-linear) to characterize how API functions consume memory based on whether they distinguish keys (K) and aggregate values (V), and how data is cached.
  2. Memory Usage Rate: A "memory usage rate" is introduced to quantify the memory impact of a task, essentially measuring the memory size of newly produced long-living data objects per unit of input data.
  3. MURS Scheduler: When memory pressure is detected (heap usage exceeding a "yellow" threshold), MURS identifies "heavy" tasks (those with linear or super-linear models, or large datasets) and temporarily suspends them. This frees up memory for "light" tasks to complete. Once memory pressure recedes (below the yellow threshold after a full GC) or a running task finishes, suspended tasks are resumed. A "red" threshold is also defined to avoid data spilling to disk.

Datasets

The paper evaluates MURS using several benchmark applications and datasets:

  • PageRank (PR): A typical iterative benchmark in Spark.
  • Aggregation Query (AQ): A common big data benchmark in SQL.
  • Sort: Used for evaluating performance without caching.
  • Scan Query (SQ): Used for evaluating performance without caching.

Datasets used: * webbase-2001 (30GB) for PR and SQ. * HiBench Random Writer (50GB) for AQ and Sort.

The authors used semantic-identical hand-written Spark programs for AQ and SQ to represent general cases.

Key Insights and Ideas

  • Service-Oriented Systems Amplify Memory Pressure: The concurrent execution model of service-oriented systems means that even light tasks can suffer significantly from the memory pressure caused by a single heavy task.
  • API Functions are the Culprits: The long-living data objects that bloat memory are primarily generated by API functions invoked by the processing frameworks. Understanding their memory usage patterns is key.
  • Intelligent Suspension is Effective: Temporarily suspending memory-intensive tasks, rather than letting them crash the system or cause excessive GC, is a viable strategy to improve overall throughput and stability.
  • Memory Usage Rate as a Unified Metric: Using a single metric like "memory usage rate" to classify tasks simplifies the scheduling decision process.

Key Results

MURS demonstrated significant improvements when compared to standard Spark in service-oriented deployments:

  • Execution Time Reduction: Decreased execution time of submitted jobs by up to 65.8%.
  • Memory Pressure Mitigation: Reduced garbage collection time by up to 81%.
  • Reduced Data Spilling: Decreased data spilling (and thus disk I/O) by approximately 90%.
  • Improved Scalability: MURS could provide high-quality service even with reduced heap sizes, indicating better scalability. For instance, MURS could operate with a heap size of 15GB where standard Spark would throw an Out-of-Memory error (OME) at 17GB.

Limitations and Future Work

  • Potential Starvation: The authors acknowledge that suspending tasks can lead to potential starvation. They address this by using a FIFO queue for resuming suspended tasks and by noting that the transient suspension is a trade-off for overall performance.
  • Estimation Accuracy: The memory usage rate estimation, based on sampling, can have some error, especially with complex data structures like collections. This might lead to fewer spilling tasks in MURS compared to figures that might be expected if the estimation were perfect.
  • Future Work: The paper suggests that MURS can be ported to other similar service-oriented data processing systems, implying a broader applicability beyond Spark. The authors also mention that the error exists when avoiding the spill, hinting at potential areas for further refinement in spill handling.

Summary updated

BibTeX
@inproceedings{shi2017murs,
  author = {Xuanhua Shi and Xiong Zhang and Ligang He and Hai Jin and Zhixiang Ke and Song Wu},
  title = {{MURS: Mitigating Memory Pressure in Service-Oriented Data Processing System}},
  booktitle = {ICWS},
  year = {2017},
  doi = {10.1109/icws.2017.49},
}

Loading related content...

Figure