Font Size: a A A

Research On Server Dynamic Load Balancing Technology Based On Nginx High Concurrency

Posted on:2024-08-18Degree:MasterType:Thesis
Country:ChinaCandidate:G ZhangFull Text:PDF
GTID:2568307157482134Subject:Electronic information
Abstract/Summary:PDF Full Text Request
As the number of Internet users increases year by year,massive data and services bring huge access pressure to a single server,resulting in delayed response and even downtime.At present,a better solution is to build server clusters to improve system availability in highconcurrency scenarios.As load balancing is a key technology in a cluster system,how to allocate requests effectively is a difficult point.As a widely used load balancer,Nginx’s existing algorithm does not consider the server’s load indicators or incomplete collection of indicators,and the index weight is configured by manual experience,which makes the weight setting inaccurate,resulting in load tilt in high concurrency scenarios.In order to solve the above problems,this paper proposes a dynamic load balancing algorithm based on Nginx,which combines the actual server load allocation request.In addition,a load balancing algorithm based on load prediction is proposed to distribute requests reasonably according to the predicted load value.The main research content of this paper is as follows:(1)To address the issue of Nginx’s current algorithm for request allocation,which is found to be unreasonable and leads to potential load imbalance,a solution is being proposed.this paper proposes a new load balancing algorithm based on dynamic weight.Firstly,by periodically collecting the occupancy of the four indicators of the server’s CPU,memory,disk,and network bandwidth,the initial weight is calculated from these four indicators.Secondly,introduce the two indicators of server connection number and process number,calculate the corresponding connection number weight and process number weight value,and get a final weight value by synthesizing the above three.Finally,When employing Nginx for load balancing,the backend server node weights are modified according to their final weights,and the server with the highest weight is selected to process the request.Autobench and Httperf are selected as test tools to measure the performance of the algorithm proposed in this paper and other algorithms under different numbers of concurrent requests.Based on experimental results,the proposed dynamic weight load balancing algorithm in this paper exhibits lower average response time and higher actual concurrency.(2)Aiming at the problem of inaccurate weight setting and inability to timely feedback server load status in the existing algorithm,this paper proposes a load balancing algorithm based on load forecasting by using BP neural network.Firstly,select performance parameters such as CPU utilization,and integrate them by constructing a comprehensive load evaluation function through the weighted sum method to measure the processing capacity of the server.Secondly,to address the issues of slow convergence and susceptibility to local optima in traditional BP neural networks,the particle swarm optimization algorithm can be used to optimize the network.The optimized weights and thresholds can then be assigned to the BP neural network to improve its prediction accuracy.Subsequently,the comprehensive load data collected and calculated are fed into the neural network as input samples,and by means of training and generalization,the predicted load value of the upcoming time series is obtained.Finally,the request scheduling module of Nginx distributes requests according to the load prediction value,and selects the server with the lowest predicted value to process user requests.The experimental results prove that the proposed algorithm can effectively reduce the average response time,improve the actual number of concurrent requests,and achieve better allocation of requests.
Keywords/Search Tags:Load balancing, Nginx, Dynamic weight, BP neural network, Server Load Forecasting
PDF Full Text Request
Related items