Font Size: a A A

Optimized Memory Allocation For Memcached

Posted on:2018-08-19Degree:MasterType:Thesis
Country:ChinaCandidate:N WangFull Text:PDF
GTID:2428330566451626Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
With the advent of Web2.0 era,the rise of cloud computing,Big Data has become the focus of the industry.How to efficiently process,storage Big Data become the most difficult problems of Internet companies.Key-Value storage is well adapted to this requirement because of its simple structure.Memcached is a typical Key-Value storage and have been widely used in the internet companies.Memcached uses slab memory allocator for memory management,the memory allocation scheme can not be adjusted when the load characteristics change,resulting in hit ratio decreasing and "memory calcification" phenomena.The existing solution use memory reallocation to solve this problem,but when memory reallocation is performed,these solutions simply discard the data that participates in the reallocation,resulting in a significant decrease of hit ratio after reallocation.To solve this problem,this paper designs and implements a set of high frequency data recognition and exchange algorithm.Before memory reallocation,high frequency data is recognized and the high frequency data participating in reallocation is exchanged with the low frequency data that is not involved in the reallocation,so that high frequency data that affects performance can be retained in the reallocation.The algorithm collects the frequency information of the data,and sets the weights according to the order of access time.Adjusting the frequency dividing line according to the characteristics of the load,so the algorithm can be applied to different loads and the high frequency data is stored concentrately in the exchanging process,so the overhead of exchanging is reduced.At last,the algorithm use buddy memory allocation to store the super high frequency data,so that it is not influenced by the data exchange.The experimental results show that the miss ratio of two memory calcification solution is decreased from 13.2%,11.6%% to 11.5% and 9.8% after optimizing.The average response time decreased from 142 milliseconds,191 milliseconds to 130 milliseconds,164 milliseconds.The improvement is remarkable.
Keywords/Search Tags:Memcached, Memory allocation, High and low frequency data exchange
PDF Full Text Request
Related items