Font Size: a A A

Research And Case Analysis Of High Performance Server Framework Technology Based On The Reactor Pattern

Posted on:2021-02-26Degree:MasterType:Thesis
Country:ChinaCandidate:F J NieFull Text:PDF
GTID:2427330602482633Subject:Engineering
Abstract/Summary:PDF Full Text Request
In recent years,with the rapid development of mobile Internet,the number of clients presents an exponential growth,which brings great challenges to the development of server-side programs.The server-side framework technology with high concurrency and low latency has been the focus of research.The server program should try to make the data in the processing time as short as possible,so as to free the CPU resources to process the subsequent requests,so as to solve the problem that the server program throughput decreases sharply or even goes down due to the accumulation of requests on the queue.In order to improve the development efficiency,based on the Reactor model,many high-performance server-side development frameworks such as ACE,Boost.Asio,libevent,libev and so on are generated,but there is still some improvement in throughput and response time.In this paper,the research is carried out from the aspects of communication protocols,multiplexing mechanism,and Reactor mode.The performance bottlenecks of the current server-side framework technology are analyzed.The buffer and thread pools are optimized,and the logs are optimized according to the actual application scenario.The processing logic ultimately improves the throughput of the server-side framework and reduces the response time.The framework is applied to the development of smart campus systems.The main research work and innovation of this article are as follows:(1)This paper firstly introduces the network transmission technology and multiplexing technology,including the advantages of the Reactor pattern and the design idea of the Reactor thread pool.Then,the traditional server-side framework technology based on the Reactor pattern is introduced,and the iterative process is described in detail.Then,the characteristics of server-side framework technology in each stage are compared and analyzed.Finally,the author points out that there is still some improvement in throughput and response time of the current server-side framework technology.(2)Based on the Reactor design pattern,the whole server framework is designed,including core class design,thread pool design,buffer structure design and log structure design.The buffer is redesigned to improve the efficiency of data reading and writing.The structure of thread pool is optimized to improve the processing efficiency of task queue.The double buffer log structure is designed to improve the efficiency of log reading and writing.Finally,a set of high performance server development framework based on the Reactor pattern is implemented and the throughput of the framework is tested.(3)On the basis of the server-side framework designed in this paper,a smart campus system is developed and implemented,which mainly interacts with campus smart door locks and provides data management interface to the WEB side.In the realization process,first of all,the system has carried on the detailed demand analysis.Then,a set of custom communication protocol is designed according to the requirements and all interaction processes in the server program with the campus smart door lock terminal follow this set of protocols.Finally,various business functions of the system were implemented,and functional tests and stress tests were performed on the system.
Keywords/Search Tags:Reactor, Throughput, IO, Thread pool, Wisdom campus
PDF Full Text Request
Related items