Font Size: a A A

Research And Implementation Of Caching Framework Based On Asynchronous I/O

Posted on:2024-02-14Degree:MasterType:Thesis
Country:ChinaCandidate:L LiuFull Text:PDF
GTID:2558307073968399Subject:Software engineering
Abstract/Summary:
With the development of the Internet,the surge in the number of users and web requests has put servers under increasing pressure for highly concurrent access.Caching technologies have emerged to not only significantly improve application performance but also reduce server load.Node.js,whose event-driven and asynchronous I/O features make it inherently capable of handling highly concurrent requests,has been rising in the rankings of server languages in recent years.Several mature and high-performing caching frameworks are available under the Java platform,but a more mature caching framework does not yet exist under Node.js.The existing Node.js caching frameworks have the following two main problems:(1)simple cache structure,which usually has only one level of cache,resulting in limited cache space;(2)low hit rate of cache replacement strategies,which usually uses traditional replacement strategies such as LFU and LRU to perform cache replacement,and the hit rate is generally not high.To address the problems of the existing Node.js caching framework,the following solutions are proposed:(1)In terms of cache structure,a memory->disk second-level cache is implemented to take full advantage of different storage media to save memory space and increase cache capacity,which can improve data access speed and reliability;(2)In terms of replacement strategy,the spectral clustering algorithm is applied to the replacement strategy,and a replacement strategy based on spectral clustering is proposed.This strategy takes into account the local attributes and global attributes,and can better eliminate low-value resources while retaining high-value resources.To form a complete caching framework,this paper designs and implements a new Node.js caching framework based on the proposed solution,which consists of three main modules:(1)a collaborative interaction module,which encapsulates both memory and disk modules and provides an interface to cache services for users,and is also responsible for migrating cache objects between memory and disk when the framework is running;(2)an in-memory caching module,which uses a cache replacement strategy based on spectral clustering and combined with the data structure of an array linked list,to provide efficient cache lookup and replacement services;(3)the disk file cache module,which stores cache objects in disk files through serialization and restores the disk cache contents through deserialization.In this paper,a comprehensive and systematic test of the framework is conducted and the results are analyzed.The test results show that the hit rate of the cache replacement strategy based on spectral clustering is significantly improved compared with LFU,etc.Compared with other caching frameworks on Node.js,the hit rate of this paper’s caching framework is significantly improved,and the time spent on acquiring cache resources is lower than that of the pure disk caching framework,and the application of disk provides both data persistence and cache capacity expansion,which proves the design rationality of the framework.
Keywords/Search Tags:Asynchronous I/O, Node.js, Cache replacement strategy, Spectral clustering, Hit ratio
Related items