电子科技 ›› 2023, Vol. 36 ›› Issue (9): 79-85.doi: 10.16180/j.cnki.issn1007-7820.2023.09.012

• • 上一篇    下一篇

一种基于改进遗传算法的动静态负载均衡算法

胡逸飞,包梓群,包晓安   

  1. 浙江理工大学 信息学院,浙江 杭州 310018
  • 收稿日期:2022-04-13 出版日期:2023-09-15 发布日期:2023-09-18
  • 作者简介:胡逸飞(1995-),男,硕士研究生。研究方向:嵌入式与服务器开发。|包梓群(2001-),男,本科生。研究方向:图像处理,智能信息处理。|包晓安(1973-),男,博士,教授。研究方向:智能信息处理。
  • 基金资助:
    国家自然科学基金(6207050141);国家级大学生创新创业训练计划项目(202010338024)

A Dynamic-Static Load Balancing Algorithm Based on Improved Genetic Algorithm

HU Yifei,BAO Ziqun,BAO Xiaoan   

  1. School of Information, Zhejiang Sci-Tech University,Hangzhou 310018,China
  • Received:2022-04-13 Online:2023-09-15 Published:2023-09-18
  • Supported by:
    National Natural Science Foundation of China(6207050141);National Student Innovation and Entrepreneurship Training Program(202010338024)

摘要:

针对目前负载均衡算法在低负载情况下影响系统效率及在高负载情况下分配效率不佳等问题,基于Nginx服务器,文中提出了一种在改进遗传算法基础上动静态结合的负载均衡算法。该算法选择使用CPU性能、内存性能、磁盘I/O和网络带宽等服务器性能参数作为服务器节点性能评价指标及低负载下的静态加权轮询算法权值,并基于该指标根据节点性能使用率所占集群平均负载使用率的变化,设计了在高负载情况下的动态负载均衡算法。通过引入操作转换阈值及动态三角函数操作概率的改进遗传算法,实现了静态算法优势区转变为动态算法优势区的阈值计算。通过设计对比实验,证明了文中算法在实验环境下相比于加权轮询算法、概率择优算法和dnfs_conn算法更具有较好的负载均衡效果,相比于dnfs_conn算法在平均响应时间和实际并发连接数等数值上具有15%左右的提升。

关键词: Nginx, 负载均衡, 性能评价, 服务器集群, 遗传算法, 动态算法, 静态算法, 加权轮询

Abstract:

In view of the problems that current load balancing algorithm affects system efficiency under low load and poor distribution efficiency under high load, based on Nginx server, a dynamic and static load balancing algorithm based on improved genetic algorithm is proposed in this study. The algorithm chooses to use server performance parameters based on CPU performance, memory performance, disk I/O and network bandwidth as server node performance evaluation indexes and static weighted polling algorithm weights under low load, and designs a dynamic load balancing algorithm under high load based on the change of node performance utilization rate as a percentage of the cluster average load utilization rate by introducing operation conversion thresholds and dynamic. By introducing the improved genetic algorithm of operation transition threshold and dynamic triangular function operation probability as the threshold calculation method, the transformation of static algorithm dominant area into dynamic algorithm dominant area is calculated. This study designs comparison experiments to verify that the proposed algorithm has better load balancing effect when compared with weighted polling algorithm, probabilistic meritocracy algorithm and dnfs_conn algorithm in the experimental environment, and has about 15% improvement in the values of average response time and actual concurrent connections when compared with dnfs_conn algorithm.

Key words: Nginx, load balancing, performance evaluation, server clustering, genetic algorithms, dynamic algorithm, static algorithms, weighted polling

中图分类号: 

  • TP368.5