Font Size: a A A

The Design And Imlementation Of Event Mechanism Subsystem In Distributed Cache

Posted on:2017-06-29Degree:MasterType:Thesis
Country:ChinaCandidate:H Y ChengFull Text:PDF
GTID:2348330518494770Subject:Computer technology
Abstract/Summary:PDF Full Text Request
In recent years,diverse Internet applications,such as Baidu search engine,Taobao,Wechat,Meituan and etc,have penetrated into every necessary field of people's basic life and brought great changes into users' work and study.Nearly thousands of users per second use these applications.It becomes a significant concern to address the problem of disk I/O response delay,which is caused by the high concurrent accesses to the database when amount of user access increases.A key method to address the high concurrent data delay in a server-side application is to employ cache technology.When tackling high concurrency problem,for quickly processing requests,the server requires non-blocking processing network I/O as well as a variety of timing tasks.Therefore,server requires an efficient subsystem based on event mechanism,such as Libevent in Memcache.Libevent,currently,as general event mechanism,is widely used in the server,which is open source,event-driven,cross-platform network processing base that provides a simple API to facilitate project development.However,to meet demands of universal use and many platforms,Libevent implements complex codes,which greatly declines its performance.Besides,due to complete code package,Libevent cannot be extended.Therefore,if the higher efficiency of the event mechanism is required in a project development,specific design is inevitably needed and implemented according to specific needs.,This thesis mainly introduces the design and implementation of event mechanism subsystem in distributed cache,which is proposed when an application server faces high concurrency issues.The project is based on Linux operating system and uses C Language.The internal of subsystem adopts multiple threads to solve the problem of client's high concurrency,modifies master-worker pattern adopted in parallel processing,and packages multi-threaded module into internal subsystem.And the number of internal thread pool can be set via task number and epoll is employed to process network I/O and quickly respond to customer requests.To reduce system fluctuation caused by a great number of event migrations,the event manager adopts double hash table and takes a gradual migration strategy that amortizes system cost.Considering that the system needs a large number of timer events,the timer of subsystem adopts Cascade Correlation algorithm.Within it,the complexity of time event insert and deletion are in the O(1),and time complexity does not increase along with the rise of fixed-time events.Besides,the design can indicate a wide range of time span as well as reduce memory usage.After experimental testing,distributed cache system based on the network I/O processing module can acquire stable and efficient operation.
Keywords/Search Tags:event mechanism, high and concurrent, multi-core server, double hash, epoll, thread pool, Timing Cascade Correlation algorithm
PDF Full Text Request
Related items