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)是一种面向通用键值存储(KVS)的算法,用于管理由具有不同访问模式、键值大小及各异键值对成本的应用程序所计算的键值对。CAMP是对贪心对偶大小(GDS)算法的近似实现,其执行效率可与LRU算法相媲美。具体而言,CAMP的淘汰策略在效果上与GDS相当,但仅需对内部数据结构进行少量更新即可做出淘汰决策。与使用队列实现LRU类似,该策略能基于不同键值对的请求历史自适应变化的工作负载模式。相较于LRU,其优势在于同时考虑了键值对的尺寸与成本,从而在竞争性应用间最大化可用内存的效用。我们将CAMP与LRU及另一种需要人工干预将内存划分为池并为键值对分组分配不同池的方案进行了对比。实验结果表明,CAMP在保持与LRU相当速度的同时,性能优于LRU及分池方案。我们还展示了基于Twitter定制版memcached实现CAMP的测试结果。