分布式緩存系統(tǒng)的內(nèi)存利用率和并發(fā)性能優(yōu)化機(jī)制
發(fā)布時(shí)間:2018-02-09 06:47
本文關(guān)鍵詞: 分布式緩存系統(tǒng) 內(nèi)存利用率 并發(fā)性能 布谷鳥(niǎo)哈希 樂(lè)觀并發(fā)控制 出處:《華中科技大學(xué)》2013年碩士論文 論文類型:學(xué)位論文
【摘要】:Memcached是一個(gè)高性能的分布式內(nèi)存對(duì)象緩存系統(tǒng),它通過(guò)在內(nèi)存中緩存對(duì)象來(lái)減少讀取數(shù)據(jù)庫(kù)的次數(shù),提高數(shù)據(jù)庫(kù)讀寫(xiě)速度。隨著web應(yīng)用的高速發(fā)展,Memcached在緩存領(lǐng)域發(fā)揮越來(lái)越重要的作用,對(duì)Memcached內(nèi)存利用率和并發(fā)性能的要求也越來(lái)越高,尋求同時(shí)滿足應(yīng)用服務(wù)和性能需求的優(yōu)化機(jī)制,是目前亟待解決的問(wèn)題。 結(jié)合對(duì)Memcached工作負(fù)載特征分析,和不同系統(tǒng)內(nèi)存利用率和并發(fā)機(jī)制的分析對(duì)比,,以偏重小對(duì)象鍵值存儲(chǔ)和讀操作為主的工作負(fù)載,難以兼顧內(nèi)存利用率和高并發(fā)請(qǐng)求。據(jù)此提出了相應(yīng)的解決方案:優(yōu)化布谷鳥(niǎo)哈希算法,用其取代系統(tǒng)中默認(rèn)的開(kāi)鏈哈希算法,實(shí)現(xiàn)哈希表高占用,從而提高M(jìn)emcached內(nèi)存利用率;優(yōu)化哈希表查詢插入算法,基于標(biāo)記值的查詢和插入保持哈希表操作的緩存友好性,實(shí)現(xiàn)對(duì)哈希表的多讀單寫(xiě)并發(fā)訪問(wèn);基于計(jì)數(shù)器的樂(lè)觀并發(fā)控制采用版本計(jì)數(shù)器來(lái)替換原系統(tǒng)全局鎖,通過(guò)版本號(hào)的改變發(fā)現(xiàn)并發(fā)的替換操作,減小內(nèi)部線程同步,確保數(shù)據(jù)一致性,允許大量并發(fā)訪問(wèn),降低插入查詢開(kāi)銷。 基于Linux操作平臺(tái)和cpu密集型計(jì)算,實(shí)現(xiàn)了Memcached的內(nèi)存利用率和并發(fā)性能優(yōu)化,在維持了內(nèi)存高效率的前提下,提高了Memcached多讀單寫(xiě)的高并發(fā)訪問(wèn)。系統(tǒng)測(cè)試采用符合zipf分布的測(cè)試數(shù)據(jù)集,存儲(chǔ)相同記錄,優(yōu)化后的系統(tǒng)內(nèi)存占用比原系統(tǒng)內(nèi)存占用率減小20%;客戶端請(qǐng)求讀寫(xiě)高并發(fā)時(shí),優(yōu)化后的系統(tǒng)相較原系統(tǒng),吞吐量至少提高2倍。
[Abstract]:Memcached is a high-performance distributed memory object caching system that reduces the number of database reads by caching objects in memory. With the rapid development of web applications, Memcached plays a more and more important role in the field of cache, and demands more and more high memory utilization and concurrent performance of Memcached. It is an urgent problem to seek optimization mechanism to meet both application service and performance requirements. Combining the characteristic analysis of Memcached workload, comparing with the memory utilization and concurrency mechanism of different systems, the workload, which is mainly focused on small object key value storage and read operation, is analyzed and compared with different system memory utilization and concurrency mechanism. It is difficult to take account of memory utilization and high concurrent request. Based on this, the corresponding solutions are put forward: optimizing the cuckoo hashing algorithm, replacing the default open-chain hash algorithm in the system to achieve high hash table occupancy, thus improving the Memcached memory utilization rate; The algorithm of hash table query insertion is optimized, and the cache friendliness of hash table operation is maintained based on the query and insert of tag value, and the multiple read single write concurrent access to hash table is realized. Optimistic concurrency control based on counter uses version counter to replace the global lock of original system, finds concurrent replacement operation by changing version number, reduces internal thread synchronization, ensures data consistency, and allows a large number of concurrent access. Reduce insert query overhead. Based on Linux operating platform and cpu intensive computing, the memory utilization and concurrency performance of Memcached are optimized, and the high memory efficiency is maintained. The system test adopts the test data set that accords with the zipf distribution, stores the same record, the optimized system memory occupation reduces 20% compared with the original system memory occupation, when the client requests the reading and writing high concurrency, the system test adopts the test data set which conforms to the zipf distribution, and stores the same record, the optimized system memory occupation reduces 20% compared with the original system memory occupation. The throughput of the optimized system is at least 2 times higher than that of the original system.
【學(xué)位授予單位】:華中科技大學(xué)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2013
【分類號(hào)】:TP333.1
【參考文獻(xiàn)】
相關(guān)期刊論文 前1條
1 楊艷;李煒;王純;;內(nèi)存數(shù)據(jù)庫(kù)在高速緩存方面的應(yīng)用[J];現(xiàn)代電信科技;2011年12期
本文編號(hào):1497329
本文鏈接:http://sikaile.net/kejilunwen/jisuanjikexuelunwen/1497329.html
最近更新
教材專著