LRC: Dependency-aware cache management for data analytics clusters

Yinghao Yu, Wei Wang, Jun Zhang, Khaled Ben Letaief

TL;DR

This paper introduces Least Reference Count (LRC), a novel cache management policy for data analytics clusters that leverages application-specific data dependency graphs (DAGs). By prioritizing eviction of data blocks with the fewest dependent future computations, LRC significantly improves cache hit rates and application performance, achieving up to a 60% speedup over traditional LRU policies.

What Problem Does This Paper Address?

Modern data analytics clusters rely heavily on in-memory caching to accelerate processing, especially for iterative and interactive workloads. However, existing cache management policies, like the ubiquitous Least Recently Used (LRU), are "history-blind" – they make eviction decisions based solely on past access patterns (recency and frequency) without understanding how data is actually used in the application's computation flow. This is problematic because data analytics applications often have well-defined data dependencies, typically represented as Directed Acyclic Graphs (DAGs). When caches are unaware of these dependencies, they might evict crucial data blocks that are needed for future computations, leading to inefficient caching, low hit rates, and increased response times. The paper aims to bridge this gap by exploiting the semantic information within application DAGs to make smarter, dependency-aware caching decisions.

Methods

The core innovation is the Least Reference Count (LRC) policy. Instead of relying on historical access patterns, LRC uses the reference count of a data block. The reference count for a block is defined as the number of its child blocks (i.e., blocks that depend on it for computation) that have not yet been computed.

Here's how it works:

  • Reference Count Calculation: The system needs access to the application's DAG. For each data block, its reference count is the number of downstream computations that require it.
  • Eviction Strategy: When the cache is full and a new block needs to be brought in, LRC evicts the block with the smallest reference count. The intuition is that blocks with a lower reference count are less likely to be needed in the immediate future.
  • LRC-Online: To address scenarios where the full DAG isn't available upfront (e.g., in multi-tenant environments or for ad-hoc queries), the paper proposes LRC-Online. This variant dynamically updates the reference count based on the DAGs of submitted jobs, approximating the offline LRC policy.

Datasets

The paper evaluates its approach using the SparkBench suite, a collection of 15 applications covering machine learning, graph computation, SQL queries, and streaming workloads. They also mention using Amazon EC2 instances for their experiments. No new benchmarks were introduced; instead, they focused on characterizing the behavior of existing, representative data analytics applications.

Key Insights and Ideas

  • DAGs are a Goldmine for Caching: The most significant insight is that the semantic information encoded in application DAGs is far more predictive of future data needs than simple historical access patterns (recency/frequency).
  • "Inactive Data" is Abundant: Empirical studies revealed that a large portion of cached data quickly becomes inactive and is unlikely to be used again, wasting valuable cache space. This inactivity often occurs in waves, aligned with computation stages.
  • Reference Count is a Superior Predictor: The reference count proved to be a more accurate indicator of future data access likelihood compared to recency and frequency. Blocks with higher reference counts are more likely to be needed soon.
  • LRC Offers Significant Space Savings: LRC not only improves performance but also achieves comparable or better cache hit ratios using significantly less cache space than LRU.
  • LRC-Online is a Practical Approximation: The online version of LRC demonstrates that even with incomplete DAG information, dependency-aware caching can still outperform traditional methods, making it viable for dynamic environments.

Key Results

  • Performance Speedup: LRC achieved up to a 60% reduction in application runtime compared to LRU in their Spark implementation.
  • Cache Space Efficiency: LRC could achieve the same cache hit ratio as LRU using only 40% of the cache spaces. For instance, achieving a hit ratio of 0.7 for Pregel Operation required 0.55 GB with LRU but only 0.22 GB with LRC.
  • Hit Ratio Improvement: In some cases, LRC led to cache hit ratios up to 119% higher than LRU.
  • LRC-Online Performance: LRC-Online closely approximated LRC's performance, outperforming LRU significantly, though with a slight performance degradation for applications with long inter-job data dependencies (like SVD Plus Plus).
  • Multi-Tenant Benefits: In multi-tenant scenarios where cache resources are heavily contended, LRC-Online showed even greater performance gains over LRU, especially with smaller cache sizes or more tenants.

Limitations and Future Work

  • DAG Availability: The effectiveness of LRC relies on having access to the application's DAG. While LRC-Online addresses this for dynamic environments, it's an approximation. The paper notes that for applications with complex iterative DAGs or where DAGs are not readily available, the accuracy might be affected.
  • Reference Distance: For applications with long reference distances (i.e., data is used much later in a different job), LRC-Online might prematurely evict data because it only knows about the current job's DAG. This was observed with SVD Plus Plus.
  • Future Work: The authors suggest adapting LRC to other DAG-based data parallel systems and extending it to multi-tenant cache sharing systems. They also hint at further optimizations for LRC-Online to better handle complex iterative DAGs.

Summary updated

BibTeX
@inproceedings{yu2017lrc,
  author = {Yinghao Yu and Wei Wang and Jun Zhang and Khaled Ben Letaief},
  title = {{LRC: Dependency-aware cache management for data analytics clusters}},
  booktitle = {INFOCOM},
  year = {2017},
  doi = {10.1109/infocom.2017.8057007},
}
Figure