Font Size: a A A

Research And Implementation Of High Concurrency Scenarios Based On Netty And Redis

Posted on:2023-05-14Degree:MasterType:Thesis
Country:ChinaCandidate:J M WanFull Text:PDF
GTID:2568306836973939Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Under the background of the era of Internet application blowout growth,the number of Internet users is increasing rapidly,and the application traffic of websites and servers is increasing rapidly.The huge request traffic has caused great load pressure on the server.In this case of high concurrent user requests,it is likely to cause server performance degradation and server downtime.For the server,it needs to be able to handle massive I / O data requests,which requires the server to have excellent communication performance.As an excellent service communication framework,netty can well improve the communication performance of the server.This technology can efficiently handle concurrent requests through the optimization of buffer and I / O thread scheduling,and developers can use netty to customize the processor to process messages,This makes the development process more flexible,and improves the data interaction ability in combination with redis caching technology.At the same time,the application of a single server has been unable to withstand a wide range of concurrent access and data impact,so it needs to adopt the scheme of cluster composed of multiple servers.In the cluster environment,it needs to distribute the requests to the server nodes through reasonable load balancing strategy for processing.This paper uses netty and redis technology to build a server framework,realizes a server with high availability and high performance,and puts forward an improvement strategy based on the weighted polling load balancing algorithm.The main work of this paper is as follows:(1)According to the function and performance requirements of the server,the I / O model and scheduling model of netty are studied and adjusted according to the specific technical scheme.The main implementation includes core modules such as codec,service registration and discovery,heartbeat detection and disconnection reconnection,so as to build a server with excellent performance.(2)Aiming at the problem of message serialization,this paper uses binary protocol to realize the encoding and decoding of messages,improve the transmission efficiency of messages,and solve the problem of sticking packets.(3)In view of the possible downtime of the server in the high concurrency scenario,this paper can find the specific downtime nodes in time by using heartbeat detection,and add the function of disconnection and reconnection,so as to reduce the impact of server downtime on the performance of the overall system.(4)Aiming at the disadvantage that the static load balancing strategy can not reasonably allocate the client requests according to the load information of the server node,a dynamic load balancing strategy based on CPU and memory is proposed based on the weighted polling strategy.The algorithm will periodically collect the state information of the server node,calculate the weight of the server node and change the weight,Finally,the experimental results verify that the dynamic load balancing algorithm proposed in this paper is effective.
Keywords/Search Tags:High concurrency, Netty, Load balancing, Heartbeat detection
PDF Full Text Request
Related items