基于池化技术的分布式数据缓存模型研究与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
分布式技术的普遍应用,使传统的Web系统面临越来越大的挑战。客户端大量的并发请求导致服务器负载过重,业务逻辑和事务处理都受到影响。其中,并发访问情况下,响应速度慢和数据利用率低的问题大大制约了Web系统性能。
     在客户端和服务器之间加入中间层可解决上述问题,本文的中间层包括线程池、数据库连接池和分布式数据缓存三部分,与客户端和服务器组建成分布式池化数据缓存模型(DPDCM)。本模型的主要功能是用线程池处理客户端请求的业务逻辑,用连接池来优化数据库连接,用分布缓存提高数据利用率。
     主要改进工作包含下面三部分:
     第一,针对用户并发的访问控制,本文采用多线程的并发控制技术设计线程池,通过对池中线程数量的动态优化调整来提升线程池性能,使其能处理更多并发请求;第二,针对频繁的数据库连接请求,文中的数据库连接池采取两种不同的复用连接策略,并建立具有延迟释放功能的应急池,以应对某段时间内的高并发请求连接的情况;第三,针对大量的相近数据访问,本文采用与传统数据缓存不同的分布缓存方法,设计了DPDCM的缓存对象结构,改进了缓存替换算法和一致性维护策略,采用LRU-M替换算法和TTL与服务端失效模式相结合的一致性维护策略管理缓存,并对相关的技术进行了理论分析。
     本文将DPDCM应用到实际的社区论坛开发中,介绍了池化技术和分布式数据缓存的具体实现方法,最后对模型及其使用的技术进行了应用场景的设计和测试。实验表明,改进后的分布式池化数据缓存系统缩短了平均响应时间并提高了数据缓存命中率,本文解决方案比传统方法更适合如今的Web系统。
The application of distributed technology has brought great challenges to conventional Web systems.A great number of simultaneous requests from clients give a big burden to servers and bring some problems on performance.In fact,the slow down of the reaction speed and low efficiency of data utilization have become the bottle-neck of system performance.
     The middle tier is imported between the clients and servers can solve these problems, including thread pool,database connection pool and distributed data cache three parts,the clients and the database with it together established the distributed pooling data cache model(DPDCM).The main function of this model is use the thread pool to deal with requests,use connection pool to optimize database connection,and use distributed cache to improve the efficiency of data utilization.
     The main improvements of this paper include the following three parts.
     First,this paper utilizes multi-threaded concurrency control technique to design the threads pool to manage the number of threads dynamically.Second,two kinds of different reuse strategies are used in database connection pool,and establish emergency pool with delayed releasing algorithm to deal with high concurrent request.Third,this paper designs the new structure of cache objects,improves LRU-M cache replacement algorithm and cache consistency management of the server failure mode and TTL combination.We also analyze the efficiency and feasibility of technologies in theory.
     This paper applies DPDCM to the development of community forums,and explains the realization methods.Finally utilizes the application scheme to test the performance of technologies in DPDCM.The results show that the improved distributed cache system shortens the reaction time and improves the rate of cache hit,so the new system is more suitable for today's web systems than the tridational methods.
引文
[1]陈丽冰.基于J2EE的Web应用系统的性能优化方法研究.计算机科学,2006,33(7):95-97
    [2]Xavier Vera,Bj(o|¨)rn Lisper,Jingling Xue.Data Cache Locking for Higher Program Predictability.Proceedings of the 2003 ACM SIGMETRICS international conference on Measurement and modeling of computer systems,2003:272-282
    [3]肖和平,韩伟红,贾焰等.StarCCM 2.0中高性能线程池模型的研究与实现.计算机工程,2005,31(24):67-69
    [4]杨刚,周兴社,潘惠芳.基于反馈的自适应线程池管理框架.计算机工程,2006,32(5):65-67
    [5]Chulho Shin,Seong-Won Lee,Jean-Lu Gaudiotc.Adaptive Dynamic Thread Scheduling for Simultaneous Multithreaded Architectures with a Detector Thread.Journal of Parallel and Distributed Computing,2006,66(10):1304-1321
    [6]DongHyun Kang,Saeyoung Han,SeoHee Yoo.Prediction-based Dynamic Thread Pool Scheme for Efficient Resource Usage.Proceedings of the 2008 IEEE 8th International Conference on Computer and Information Technology Workshops,2008:159-164
    [7]Azzedzne Boukerche,Kaiyuan Lu.Design and Performance Evaluation of a Real-Time RTI Infrastructure for Large-scale Distributed Simulations.Proceedings of the 2005 Ninth IEEE International Symposium on Distributed Simulation and Real-Time Applications,2005:203-212
    [8]魏常辉,夏克俭,曾德华.基于XML的自优化数据库连接池的设计与实现.计算机应用研究,2005,22(7):206-209
    [9]Guoliang Feng,Lianhe Yang.A New Method in Improving Database Connection Pool Model.Proceedings of world academy of science,Enineering and Technology.2007,23(8):246-249
    [10]S.Chen,F.Y.Lu.Web-based Simulations of Power Systems.IEEE Computer Applications in Power,2002,15(1):35-40
    [11]王建华,何盈捷.提高数据库事务处理性能的中间件设计.计算机科学,2004,31(2):71-75
    [12]Sung-Mee Park,Jeong-Hwan Song.Load Balancing Method Using Connection Pool in RFID Middleware.Proceedings of the 5th ACIS International Conference on Software Engineering Research,Management & Applications,2007:132-137
    [13]Jun Yang,Rajiv Gupta.Energy Efficient Frequent Value Data Cache Design.Proceedings of the 35th Annual ACM/IEEE International Symposium on Microarchitecture,2002:197-207
    [14]Amiri K,Sanghyun Park,Tewari R.A dynamic data cache for web applications.Proceedings of the 19th International Conference on Data Engineering,2003:821-831
    [15]黄世能,奚建清.分布数据缓存体系.软件学报,2001,12(7):1094-1100
    [16]郑晓薇,郑纬民,沈美明.一种基于结点的分布式合作缓存管理算法DCC.计算机研究与发展,1999,36(9):1057-1061
    [17]Duane Wessels,K.Claffy.ICP and the Squid Web Cache.IEEE Journal on Selected Areas in Communications,1998,16(3):345-357
    [18]Yu Du,Sandeep K.S,Georgios Varsamopoulos.Improving on Demand Data Access Efficiency in MANETs with Cooperative Caching.Ad Hoc Networks,2009,7(3):579-598
    [19]Mukund Raghavachari,Darrell Reimer,Robert D.Johnson.The deployer's problem:Configuring Application Servers for Performance and Reliability.Proceedings of the 25th International Conference on Software Engineering,2003:484-489
    [20]水超,李慧.对象池模式的扩展与设计.计算机工程,2004,30(9):26-28
    [21]王华,马亮,顾明.线程池技术研究与应用.计算机应用研究,2005(11):141-143
    [22]李刚,金蓓弘.基于线程的并发控制技术研究与应用.计算机工程,2007,33(14):43-45
    [23]Hibemate API Documentation.http://www.hibemate.org/hib_docs/v3/api/
    [24]贺琛,陈肇雄,黄河燕.Web缓存技术综述.小型微型计算机系统,2004,25(5):836-842
    [25]曹丽娟,谢强,丁秋林.基于分布式数据缓存技术的Web-OLAP系统研究.计算机应用,2008,28(2):515-518
    [26]Kataoka Mikio,Toumura Kunihiko,Okita Hideki.Distributed Cache System for Large-Scale Networks.Proceedings of the International Multi-Conference on Computing in the Global Information Technology,2006:40-45
    [27]符青云,刘心松.基于协同缓存分布式数据库更新机制研究.计算机工程,2007,33(7):47-49
    [28]陈珉,喻丹丹,涂国庆.分布式数据库系统中数据一致性维护方法研究.国防科技大学学报,2002,24(3):76-80
    [29]Dash S.K.,Srikanthan T.Rapid Estimation of Instruction Cache Hit Rates using Loop Profiling.Application-Specific Systems,Architectures and Processors,2008:263-268
    [30]黄敏,蔡志刚.缓存替换算法研究综述.计算机科学,2006,33(12):191-193
    [31]Yuanyuan Zhou,Zhifeng Chen,Kai Li.Second-level Buffer Cache Management.IEEE Transactions on Parallel and Distributed Systems,2004,15(6):505-519
    [32]Java开源系统.http://www.codeok.com/opensource/java/javahc/index.shtml
    [33]翟征德,李大兴.基于线程池技术WWW代理服务器的设计与实现.计算机研究与应用,2004(5):87-89
    [34]Dongping Xu,Brett Bode.Performance Study and Dynamic Optimization Design for Thread Pool systems.Proceedings of the International Conference on Computing,Communications and Control Technologies,2004:272-277
    [35]隋秀峰,吴俊敏,陈国良.同时多线程处理器上的Cache性能分析与优化.小型微型计算机系统,2009,30(1):159-163
    [36]Ling Y,Mullen T,Lin X.Analysis of Optimal Thread Pool Size.New York,USA:ACM Operating Systems Review,SIGOPS,ACM Press,2000:42-55
    [37]G(?)bor Imre,(?)gnes Bog(?)rdi-M(?)sz(o|¨)ly.Measuring and Modelling the Effect of Application Server Tuning Parameters on Performance.4th Slovakian-Hungarian Joint Symposium on Applied Machine Intelligence,2006:471-482
    [38]赵玉伟,赵小雨,乔木.缓存技术在B/S架构信息系统中的应用.计算机工程,2008,34(1):233-235
    [39]Jingling Xue,Xavier Vera.Efficient and Accurate Analytical Modeling of Whole-program Data Cache Behavior.IEEE Transactions on Computers,2004,53(5):547-566
    [40]Jaeheon Jeong,Michel Dubois.Cost-Sensitive Cache Replacement Algorithms.Proceedings of the 9th International Symposium on High-Performance Computer Architecture,2002:327-337
    [41]Mazen Kharbutli,Yan Solihin.Counter-Based Cache Replacement Algorithms.Proceedings of the 2005 International Conference on Computer Design,2005:61-68
    [42]Leonid B.Sokolinsky.LIRS:an Efficient Low Inter-reference Recency Set Replacement Policy to Improve Buffer Cache Performance.Proceedings of the 2002ACM SIGMETRICS international conference on Measurement and modeling of computer systems,2002:31-42
    [43]Jaafar Alghazo,Adil Akaaboune,Nazeih Botros.SF-LRU Cache Replacement Algorithm.Records of the 2004 International Workshop on Memory Technology,Design and Testing,2004:19-24
    [44]Predrag R.Jelenkovi'c,Ana Radovanovi'.Least-recently-used Caching with Dependent requests.Theoretical Computer Science,2004,326(1-3):293-327
    [45]Zhansheng Li,Dawei Liu,Hui-juan Bi.CRFP:A Novel Adaptive Replacement Policy Combined the LRU and LFU Policies.Proceedings of the 2008 IEEE 8th International Conference on Computer and Information Technology Workshops,2008:72-79
    [46]周婧,王意洁,李思昆.一种基于数据相关性的优化数据一致性维护方法.计算机学报,2008,31(5):741-754
    [47]Xin Yu.A Distributed Adaptive Cache Update Algorithm for the Dynamic Source Routing Protocol.Proceedings IEEE INFOCOM 2005.24th Annual Joint Conference of the IEEE Computer and Communications Societies,2005,1:730-739
    [48]谢高岗,李振宇,陈嘉宁.MANET中基于簇的缓存一致性维护策略.软件学报,2008,19(11):3042-3052
    [49]何军,田范江,王鼎兴.一种机群网络文件系统的合作高速缓存技术.计算机学报,1997,20(10):899-907
    [50]阳雪峰,陈文臣.Java Web 2.0-基于Spring、Struts、Hibernate轻量级架构开发.北京:机械工作出版社,2008
    [51]Eric Freeman.Head First Design Pattern(影印版).南京:东南大学出版社,2005
    [52]陈绍英,刘建华,金成姬.LoadRunner性能测试实战.北京:电子工业出版社,2007
    [53]杨玉海,宾雪莲,郑玉墙.合作式Web缓存系统的性能分析.计算机研究与发展,2003,40(5):757-762

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700