基于Nginx的心跳触发式动态负载均衡算法
投稿时间:2025-12-15  修订日期:2025-12-31  点此下载全文
引用本文:
摘要点击次数: 54
全文下载次数: 0
作者单位邮编
马怡然* 东北石油大学计算机与信息技术学院 163318
曹舒 东北石油大学计算机与信息技术学院 
刘芳 东北石油大学计算机与信息技术学院 
中文摘要:针对高并发场景下传统负载均衡策略调度效率低、通讯开销大的问题,本文提出基于Nginx的心跳触发式动态负载均衡算法。该算法在加权轮询的基础上进行优化,通过硬件性能与实时负载情况分别构建静态权值与动态权值,并结合节点响应时间构成最终权值。动态权值中的硬件权重随硬件状态和连接数动态更新,以更准确反映节点的实际服务能力。同时,设计了心跳触发机制,整合即时的双阈值心跳发送决策和长期的动态心跳间隔调整策略,在保证状态感知及时性的同时显著降低监测通信开销。实验结果表明,该算法在高并发场景下响应时间更短,错误率更低。
中文关键词:负载均衡  Nginx  动态权值  心跳触发
 
A Heartbeat-Triggered Dynamic Load Balancing Algorithm Based on Nginx
Abstract:To address the low scheduling efficiency and high communication overhead of traditional load balancing strategies under high-concurrency scenarios, this paper proposes a heartbeat-triggered dynamic load balancing algorithm based on Nginx. The algorithm improves upon the weighted round-robin method by constructing static and dynamic weights from hardware performance and real-time load information, respectively, and combining them with node response time to form the final weight. The hardware weight in the dynamic component is updated according to hardware status and connection count, enabling a more accurate reflection of the actual service capability of each node. In addition, a heartbeat-triggered mechanism is designed by integrating an immediate dual-threshold heartbeat decision strategy with a long-term adaptive heartbeat interval adjustment scheme, which significantly reduces monitoring communication overhead while ensuring timely state awareness. Experimental results demonstrate that the proposed algorithm achieves shorter response time and lower error rate in high-concurrency environments.
keywords:load balancing  nginx  dynamic weighting  heartbeat mechanism
查看全文   查看/发表评论   下载pdf阅读器