首页|基于Nginx的动态权重负载均衡技术研究

基于Nginx的动态权重负载均衡技术研究

扫码查看
负载均衡策略在保障Web服务器集群稳定运行和性能方面是不可或缺的。在众多的负载均衡技术中,Nginx得到了广泛应用,常被大规模应用于反向代理服务前端。通过对Nginx负载均衡算法的学习研究,设计实现了一种改进的动态权重负载均衡算法。该算法利用Redis缓存机制,实时采集并存储后端Web服务器的CPU利用率、内存利用率、网络带宽和磁盘I/O等性能指标信息。然后,通过熵值法计算各项性能指标的系数,并动态地修改后端Web服务器的权重。实验结果显示,与加权轮询算法和最小连接数算法相比,新算法在高并发情况下具有更好的响应时间和吞吐量。
Research on Dynamic Weight Load Balancing Technology Based on Nginx
The load balancing strategies are indispensable in ensuring the stable operation and performance of Web server clusters.Among numerous load balancing technologies,Nginx has been widely used and is often applied on a large scale in the front-end of reverse proxy services.Through the study of Nginx load balancing algorithm,an improved dynamic weight load balancing algorithm is designed and implemented.The algorithm uses the Redis cache mechanism to collect and store the CPU utilization,memory utilization,network bandwidth,disk I/O and other performance index information of the back-end Web server in real time.Then,the coefficient of each performance index is calculated by the entropy method,and the weight of the back-end Web server is dynamically modified.The experimental results show that the new algorithm has better response time and throughput in the case of high concurrency compared with the Weighted Round Robin algorithm and the Least Connections algorithm.

load balancingdynamic weightserver clusterentropy methodNginx

郑松奕、陈国良、蒋正亮、张裕祥

展开 >

暨南大学 网络与教育技术中心,广东 广州 510632

负载均衡 动态权重 服务器集群 熵值法 Nginx

2024

现代信息科技
广东省电子学会

现代信息科技

ISSN:2096-4706
年,卷(期):2024.8(20)