Memory Partitioning and Management in Memcached

Memcached is a popular component of modern Web architectures, which allows fast response times–a fundamental performance index for measuring the Quality of Experience of end-users–for serving popular objects. In this work, we study how memory partitioning in Memcached works and how it affects system performance in terms of hit ratio. We first present a cost-based memory partitioning and management mechanism for Memcached that is able to dynamically adapt to user requests and manage the memory according to both object sizes and costs. We present a comparative analysis of the vanilla memory management scheme of Memcached and our approach, using real traces from a major content delivery network operator. We show that our proposed memory management scheme achieves near-optimal performance, striking a good balance between the performance perceived by end-users and the pressure imposed on back-end servers. We then consider the problem known as “calcification”: Memcached divides the memory into different classes proportionally to the percentage of requests for objects of different sizes. Once all the available memory has been allocated, reallocation is not possible or limited. Using synthetic traces, we show the negative impact of calcification on the hit ratio with Memcached, while our scheme, thanks to its adaptivity, is able to solve the calcification problem, achieving near-optimal performance.

[1]  Harold S. Stone,et al.  Improving Disk Cache Hit-Ratios Through Cache Partitioning , 1992, IEEE Trans. Computers.

[2]  G. Edward Suh,et al.  Dynamic Partitioning of Shared Cache Memory , 2004, The Journal of Supercomputing.

[3]  Irfan Ahmad,et al.  Efficient MRC Construction with SHARDS , 2015, FAST.

[4]  Chen Ding,et al.  Program locality analysis using reuse distance , 2009, TOPL.

[5]  Yu Zhang,et al.  Improved Approximate Detection of Duplicates for Data Streams Over Sliding Windows , 2008, Journal of Computer Science and Technology.

[6]  Yingwei Luo,et al.  LAMA: Optimized Locality-aware Memory Allocation for Key-value Cache , 2015, USENIX Annual Technical Conference.

[7]  Irving L. Traiger,et al.  Evaluation Techniques for Storage Hierarchies , 1970, IBM Syst. J..

[8]  Guy E. Blelloch,et al.  Effectively sharing a cache among threads , 2004, SPAA '04.

[9]  Yingwei Luo,et al.  Optimal Cache Partition-Sharing , 2015, 2015 44th International Conference on Parallel Processing.

[10]  Song Jiang,et al.  Workload analysis of a large-scale key-value store , 2012, SIGMETRICS '12.

[11]  Krishna P. Gummadi,et al.  An analysis of Internet content delivery systems , 2002, OPSR.

[12]  Song Jiang,et al.  A Penalty Aware Memory Allocation Scheme for Key-Value Cache , 2015, 2015 44th International Conference on Parallel Processing.

[13]  Yale N. Patt,et al.  Utility-Based Cache Partitioning , 2006 .

[14]  Hao Che,et al.  Hierarchical Web caching systems: modeling, design and experimental results , 2002, IEEE J. Sel. Areas Commun..

[15]  Hjörtur Björnsson,et al.  Dynamic performance profiling of cloud caches , 2013, SoCC.

[16]  David Tse,et al.  Probabilistic methods for web caching , 2001, Perform. Evaluation.

[17]  Jason Evans April A Scalable Concurrent malloc(3) Implementation for FreeBSD , 2006 .

[18]  Andrew Warfield,et al.  Characterizing Storage Workloads with Counter Stacks , 2014, OSDI.

[19]  Armand M. Makowski,et al.  Optimal replacement policies for nonuniform cache objects with optional eviction , 2003, IEEE INFOCOM 2003. Twenty-second Annual Joint Conference of the IEEE Computer and Communications Societies (IEEE Cat. No.03CH37428).

[20]  Robert Tappan Morris,et al.  DNS performance and the effectiveness of caching , 2001, IMW '01.

[21]  Pietro Michiardi,et al.  Memory partitioning in Memcached: An experimental performance analysis , 2014, 2014 IEEE International Conference on Communications (ICC).

[22]  Tony Tung,et al.  Scaling Memcache at Facebook , 2013, NSDI.

[23]  Sandy Irani,et al.  Cost-Aware WWW Proxy Caching Algorithms , 1997, USENIX Symposium on Internet Technologies and Systems.

[24]  Bin Fan,et al.  MemC3: Compact and Concurrent MemCache with Dumber Caching and Smarter Hashing , 2013, NSDI.