TTL-based Cloud Caches

Damiano Carra, Giovanni Neglia, Pietro Michiardi

TL;DR

This paper introduces a novel dynamic algorithm for TTL (Time-To-Live) based cloud caches that adapts the number of cache instances to minimize both storage and miss costs. By using a practical, O(1) complexity approach, it achieves significant cost savings, especially in dynamic traffic scenarios, outperforming traditional fixed-size caches and offering a more scalable alternative to existing MRC-based methods.

What Problem Does This Paper Address?

Cloud-based in-memory key-value stores (caches) are crucial for services like CDNs, but their elastic provisioning in the cloud presents a challenge. The cost of these caches isn't just about storage; it also includes the significant cost of cache misses, which directly impact user experience and revenue. While auto-scaling tools exist, they often focus on linear performance-resource relationships, which don't accurately capture the non-linear dynamics of cache hit ratios. Existing research has largely ignored the cost of misses or focused solely on minimizing storage for a fixed hit ratio. This paper addresses the need for a dynamic, cost-aware caching strategy that balances storage and miss costs in elastic cloud environments.

Methods

The core of the paper is a dynamic algorithm for TTL caches. It adapts the TTL value to minimize total costs, considering both storage and miss costs. This is achieved through a stochastic approximation approach, which allows the TTL to converge to an optimal value without needing to know future traffic patterns.

For practical implementation, the authors propose a horizontally scalable system. This system uses a "virtual cache" that stores metadata of cacheable objects. The size of this virtual cache, managed by the dynamic TTL algorithm, dictates the number of physical cache instances needed. This approach ensures an O(1) computational complexity per request, which is critical for high-throughput systems like CDNs, avoiding performance bottlenecks that more complex methods might introduce. They also introduce a clairvoyant TTL-OPT policy as a theoretical lower bound, which optimally sets TTLs with full knowledge of future requests.

Datasets

The paper evaluates its approach using real-world traces from Akamai, a major Content Delivery Network. These traces span 30 days and contain request timestamps, anonymized object IDs, and object sizes. The authors also use synthetic traces generated according to the Independent Reference Model (IRM) to validate theoretical results. For cost estimations, they refer to Amazon ElastiCache pricing.

Key Insights and Ideas

  • Cost of misses is critical: The paper strongly emphasizes that cache misses have a significant, quantifiable cost that must be factored into provisioning decisions, not just storage costs.
  • TTL as a dynamic knob: TTL, often seen as a simple eviction policy, is repurposed as a powerful dynamic control parameter for elastic scaling, directly influencing cache occupancy and thus costs.
  • O(1) complexity is paramount: For high-throughput systems, any scaling mechanism must have constant time complexity per request. The proposed TTL-based approach achieves this, unlike some MRC-based methods that incur logarithmic complexity.
  • Virtual cache for physical scaling: The concept of a virtual cache managing metadata to drive the scaling of physical cache instances is an elegant way to bridge the gap between theoretical models and practical cloud deployments.
  • Dynamic adaptation in highly dynamic settings: The Super Bowl scenario highlights the significant advantage of dynamic scaling over static configurations when facing unexpected traffic surges.

Key Results

  • The proposed TTL-based dynamic scaling solution achieves cost savings comparable to more complex MRC-based approaches but with significantly lower computational overhead (O(1) vs. O(log M)).
  • Compared to a baseline fixed-size cache, the TTL-based approach saves approximately 17% of costs over a 15-day period.
  • In a highly dynamic scenario simulating the Super Bowl, the dynamic TTL solution incurred 40% less cost than a static cache sized for normal traffic and 21% less cost than a static cache sized with an underestimated forecast.
  • The clairvoyant TTL-OPT policy, which knows future requests, demonstrates that further cost savings are possible, suggesting that more sophisticated forecasting or content-aware TTL policies could be beneficial.
  • The practical TTL implementation shows only a slight difference (less than 2%) compared to the ideal, vertically scalable TTL cache, indicating that current cloud billing models and instance granularities are sufficient for significant cost optimization.

Limitations and Future Work

  • Theoretical convergence: While the paper presents theoretical results for stochastic approximation, it acknowledges that further investigation is needed for convergence analysis when updates are delayed or correlated, as is the case in the practical implementation.
  • Practical billing and instance granularity: The slight difference between ideal and practical TTL performance is attributed to the discretization of cache sizes and billing periods. While this difference is small, it suggests potential for further optimization if finer-grained options become available.
  • Content-aware TTL: The success of the clairvoyant TTL-OPT policy suggests that future work could explore dynamic TTL policies that are more aware of individual content characteristics (e.g., popularity, size, miss cost) rather than a single global TTL.
  • Forecasting integration: The paper mentions that if a priori knowledge of events (like duration or traffic forecasts) is available, the TTL policy could be adapted to react faster or be initialized more optimally, indicating a direction for future research.

Summary updated

BibTeX
@inproceedings{carra2019ttl,
  author = {Damiano Carra and Giovanni Neglia and Pietro Michiardi},
  title = {{TTL-based Cloud Caches}},
  booktitle = {INFOCOM},
  year = {2019},
  url = {https://openreview.net/forum?id=ammGBZO6sdS},
}
Figure