Font Size: a A A

Optimize Performance Of Memcached Memory Access

Posted on:2017-02-11Degree:MasterType:Thesis
Country:ChinaCandidate:J LiuFull Text:PDF
GTID:2348330503481930Subject:Computer technology
Abstract/Summary:PDF Full Text Request
In recent years, social networking, e-commerce and other interactive sites ushered in tremendous growth. Disk has been used as the main storage medium and its input/output performance has become a bottleneck of server performance. Memcached resolves the principal contradiction of the disk-based database between the CPU and input/output and has been widely used as an effective way to solve the access problem and improve the capacity of the source server. Because the important role of Memcached as well as its simple architecture and open source, many studies have focused on performance optimization of Memcached.Firstly, this paper analyzes the software architecture and source code of Memcached, neatens up the work flows and process, lay the foundation for further analysis and research. In terms of network model, Memcached is based on Client/Server model and uses Reactor event processing mode and semi-synchronous/semi-asynchronous concurrent mode; In terms of memory management, memory pool of slab and LRU(Least Recently Used) are used in Memcached to achieve efficient management. Hash tables are used for purpose of finding the objects quickly. Memcached employs a finite state machine to deal with command analysis and processing.Secondly, from the perspective of architecture and process, this paper designs a data compression scheme for Memcached. Considering the compression ratio and general purpose, DEFLATE algorithm of Zlib data compression library is chosen to achieve functionality. The experiment illustrates the impact of data compression on performance of Memcached from the number of objects, distribution of objects, the hit rate, the system delay, speed ratio, etc. Data compression helps Memcached achieve better memory access. To achieve the same hit rate, only 70% of memory is needed with data compression.Lastly, this paper analyzes the Memcached Calcification and its causes, discusses the influence of the data compression functionality on this phenomenon. In the case of the distribution of request changing over time, Calcification has more negative effect on hit rate. This paper adjusts the Linux slab mechanism to the Memcached slab allocator. Also, this paper presents Minimal Impact Factor Select algorithm to help solve the slab selection problems of Memcached memory reclamation after data compression is adapted and data characteristics of Memcached has changed. These two aspects are combined to resolve the Calcification problem. Verified by experimental tests, this program has obvious effect compared with other solutions and strategies. This scheme effectively solves the Calcification problem in case of data compression. Hit rate increases by 10%.In summary, this paper improves the memory storage density through data compression and memory usage by means of solving the Calcification problems.
Keywords/Search Tags:Memcached, data compression, Calcification, memory access
PDF Full Text Request
Related items