Font Size: a A A

Research And Improvement Of Server Cluster Load Balancing Strategy Based On Nginx

Posted on:2021-01-01Degree:MasterType:Thesis
Country:ChinaCandidate:C WuFull Text:PDF
GTID:2428330611965315Subject:Electronic and communication engineering
Abstract/Summary:PDF Full Text Request
With the widespread popularity of Internet technology,the network traffic and the number of Internet users are increasing.A single server is enduring tremendous load pressure when responding to the explosive growth of concurrent access requests,which would lead to response delay.Nowadays,the effective solution to this problem is to build a server cluster system based on Nginx.As a research focus of cluster system,the load balancing has attracted much attention.And the main goal of load balancing is to distribute a large number of requests to each server of the cluster for processing to improve the throughput,the resource utilization of the whole system and reduce the response time of requests.Therefore,the strategy of load balancing plays a vital role in improving the performance of the cluster system.In this thesis,a dynamic adaptive load balancing algorithm based on the Nginx weighted polling algorithm is proposed,according to the research of Nginx core data structure,process working model,configuration file system,reverse proxy mechanism,load balancing strategy and the structure of source code module.In the algorithm proposed,the load index utilization of CPU,memory,network bandwidth and disk IO,which will be used to calculate the remaining load weight,is collected while the server is running.Meanwhile,the response time of the server's request processing in the most recent period is collected to calculate the response time weight.Then the real-time dynamic weight of the server is obtained by the remaining load weight and the response time weight.Besides,the average value of the latest response time of all servers is applied as the threshold to divide the server state into light load and heavy load.And then the dynamic weight of each light load server,as a weight factor,is used to adjust the weight parameters in the Nginx weighted polling algorithm.It achieves the goal of modifying server weights according to the load performance of servers in real time.In this thesis,a cluster test system of Nginx and Tomcat is built,and a large number of performance comparison tests are done by using test tool,Autobench,on the weighted polling algorithm,the IP-HASH algorithm,the third-party fair algorithm and the dynamic adaptive algorithm proposed.The results show that the actual number of concurrent connections of the dynamic adaptive algorithm is improved by 7.9% compared with the fair algorithm which is the best among the other three algorithms under load saturation,and by 14.6% compared with the original weighted polling algorithm.Furthermore,the dynamic algorithm has shorter response time than the others.All of these prove that the dynamic algorithm proposed in this thesis is feasible.Compared with the other three load balancing algorithms above,the algorithm proposed in this thesis has the following characteristics:(1)More comprehensive assessment of server performance is built by considering hardware resource utilization and response time information.(2)Compared with the manually fixed weights,it is more effective to use AHP to scientifically calculate the weight coefficient vector of evaluation function and construct a comprehensive load decision function for assigning server weights.(3)The adaptive weight modification threshold is set to adjust the weight of the server in light load state.In the dynamic adaptive algorithm,the requests will be allocated to the light load server,which has the largest current weight to keep the cluster load state in dynamic balance.
Keywords/Search Tags:Nginx, load balancing, server cluster, high concurrency, dynamic load balancing algorithm
PDF Full Text Request
Related items