Table of Contents
Fetching ...

CAMP: A Cost Adaptive Multi-Queue Eviction Policy for Key-Value Stores

Shahram Ghandeharizadeh, Sandy Irani, Jenny Lam, Jason Yap

TL;DR

This work compares CAMP with both LRU and an alternative that requires human intervention to partition memory into pools and assign grouping of key-value pairs to different pools, and demonstrates CAMP is as fast as LRU while outperforming bothLRU and the pooled alternative.

Abstract

Cost Adaptive Multi-queue eviction Policy (CAMP) is an algorithm for a general purpose key-value store (KVS) that manages key-value pairs computed by applications with different access patterns, key-value sizes, and varying costs for each key-value pair. CAMP is an approximation of the Greedy Dual Size (GDS) algorithm that can be implemented as efficiently as LRU. In particular, CAMP's eviction policies are as effective as those of GDS but require only a small fraction of the updates to an internal data structure in order to make those decisions. Similar to an implementation of LRU using queues, it adapts to changing workload patterns based on the history of requests for different key-value pairs. It is superior to LRU because it considers both the size and cost of key-value pairs to maximize the utility of the available memory across competing applications. We compare CAMP with both LRU and an alternative that requires human intervention to partition memory into pools and assign grouping of key-value pairs to different pools. The results demonstrate CAMP is as fast as LRU while outperforming both LRU and the pooled alternative. We also present results from an implementation of CAMP using Twitter's version of memcached.

CAMP: A Cost Adaptive Multi-Queue Eviction Policy for Key-Value Stores

TL;DR

This work compares CAMP with both LRU and an alternative that requires human intervention to partition memory into pools and assign grouping of key-value pairs to different pools, and demonstrates CAMP is as fast as LRU while outperforming bothLRU and the pooled alternative.

Abstract

Cost Adaptive Multi-queue eviction Policy (CAMP) is an algorithm for a general purpose key-value store (KVS) that manages key-value pairs computed by applications with different access patterns, key-value sizes, and varying costs for each key-value pair. CAMP is an approximation of the Greedy Dual Size (GDS) algorithm that can be implemented as efficiently as LRU. In particular, CAMP's eviction policies are as effective as those of GDS but require only a small fraction of the updates to an internal data structure in order to make those decisions. Similar to an implementation of LRU using queues, it adapts to changing workload patterns based on the history of requests for different key-value pairs. It is superior to LRU because it considers both the size and cost of key-value pairs to maximize the utility of the available memory across competing applications. We compare CAMP with both LRU and an alternative that requires human intervention to partition memory into pools and assign grouping of key-value pairs to different pools. The results demonstrate CAMP is as fast as LRU while outperforming both LRU and the pooled alternative. We also present results from an implementation of CAMP using Twitter's version of memcached.

Paper Structure

This paper contains 9 sections, 3 theorems, 1 equation, 9 figures, 1 table, 1 algorithm.

Key Result

Proposition 1

Figures (9)

  • Figure 1: A heap used in a straightforward manner (\ref{['fig:heap-gds']}) contains many more nodes than the heap in CAMP's LRU-heap hybrid (\ref{['fig:camp-gds']}) when there are only a few distinct cost-to-size ratios.
  • Figure 2: An LRU queue within CAMP.
  • Figure 3: CAMP update on a KVS hit. If $g$ is requested (\ref{['fig:camp-hit1']}), it is moved to the back of its queue (\ref{['fig:camp-hit2']}), and the heap is updated accordingly (\ref{['fig:camp-hit3']} and \ref{['fig:camp-hit4']}).
  • Figure 4: Number of visited heap nodes as a function of the cache size ratio.
  • Figure 5: Simulation results with one trace and cost values selected from 1, 100, 10K. With \ref{['fig:simcostratio']} and \ref{['fig:simmissratio']}, the precision of CAMP is set to 5.
  • ...and 4 more figures

Theorems & Definitions (3)

  • Proposition 1
  • Proposition 2
  • Proposition 3