计算机科学 ›› 2023, Vol. 50 ›› Issue (5): 313-321.doi: 10.11896/jsjkx.220400019

• 计算机网络 • 上一篇    下一篇

基于机器学习的微服务负载均衡算法研究

杨乾龙1, 江凌云1,2   

  1. 1 南京邮电大学通信与信息工程学院 南京 210003
    2 南京邮电大学物联网研究院 南京 210003
  • 收稿日期:2022-04-02 修回日期:2022-04-19 出版日期:2023-05-15 发布日期:2023-05-06
  • 通讯作者: 江凌云(jiangly@njupt.edu.cn)
  • 作者简介:(ql2816149426@163.com)
  • 基金资助:
    江苏省重点研发计划(BE2020084-4)

Study on Load Balancing Algorithm of Microservices Based on Machine Learning

YANG Qianlong1, JIANG Lingyun1,2   

  1. 1 School of Communication and Information Engineering,Nanjing University of Posts and Telecommunications,Nanjing 210003,China
    2 Internet of Things Research Institute,Nanjing University of Posts and Telecommunications,Nanjing 210003,China
  • Received:2022-04-02 Revised:2022-04-19 Online:2023-05-15 Published:2023-05-06
  • About author:YANG Qianlong,born in 1998,postgraduate.His main research interests include microservice load balancing and machine learning.
    JIANG Lingyun,born in 1971,master,associate professor.Her main research interest is the next generation network.
  • Supported by:
    Key Research and Development Program of Jiangsu Province(BE2020084-4).

摘要: 随着云计算技术的不断发展,微服务体系结构受到了越来越多的关注。由于将大型应用程序分割成细粒度的单一服务在开发和维护方面较为方便,许多大型应用程序已经从单体结构发展为微服务体系结构。在微服务架构中,为了提高微服务的可用性,通常采用集群结构的方式部署微服务实例。针对微服务集群中服务器节点随着任务数量的增加而出现负载不均衡的问题,提出了一种基于Xgboost(Extreme Gradient Boosting)的最短预测响应时间负载均衡算法(Shortest Predictive Response Time,SPRT)。首先选取影响任务响应时间的特征参数,然后使用集成学习预测新任务的响应时间,最终将任务分配给预测响应时间最短的服务器节点,以达到服务器节点之间负载均衡的目的。结果表明,相比其他负载算法,所提负载均衡算法在吞吐量、截止率和平均响应时间上都有一定的提升,而且更适用于高并发环境下的微服务集群。

关键词: 微服务, 负载均衡, 集成学习, 预测响应时间, Xgboost

Abstract: With the continuous development of cloud computing technology,the microservice architecture has received more and more attention.Since it is more convenient in development and maintenance to divide large-scale applications into fine-grained single services,lots of large applications have evolved from monolithic architecture to microservice architecture.In the microservice architecture,in order to improve the availability of microservices,microservice instances are usually deployed in a cluster structure.Aiming at the problem of unbalanced load of server nodes in a microservice cluster with the increase of the number of tasks,a load balancing algorithm based on Xgboost,shortest predictive response time,is proposed.By selecting the characteristic para-meters that affect the response time of the task,and then using machine learning to predict the response time of new task,the task is finally assigned to the server node with the smallest predicted response time,so as to achieve the purpose of load balancing between server nodes.The results show that using the proposed load balancing algorithm has a certain improvement in throughput,cut-off rate and average response time compared with other load algorithms,and it is more suitable for microservice clusters in high concurrency environments.

Key words: Microservices, Load balancing, Ensemble learning, Predicted response time, Xgboost

中图分类号: 

  • TP302
[1]WANG H,WANG Y,LIANG G,et al.Research on Load Balancing Technology for Microservice Architecture[C]//MATEC Web of Conferences.EDP Sciences,2021.
[2]LARRUCEA X,SANTAMARIA I,COLOMO-PALACIOS R,et al.Microservices[J].IEEE Software,2018,35(3):96-100.
[3]SHAO J,ZHANG X,CAO Z.Research on Context-based In-stances Selection of Microservice[C]//Proceedings of the 2nd International Conference on Computer Science and Application Engineering.2018:1-5.
[4]YI C,ZHANG X,CAO W.Dynamic Weight Based Load Balancing for Microservice Cluster[C]//Proceedings of the 2nd International Conference on Computer Science and Application Engineering.2018:1-7.
[5]NADAREISHVILI I,MITRA R,MCLARTY M,et al.Micro-service Architecture:Aligning Principles,Practices,and Culture[M].O'Reilly Media,Inc.,2016.
[6]ZHU L,CUI J,XIONG G.Improved Dynamic Load BalancingAlgorithm Based on Least-Connection Scheduling[C]//2018 IEEE 4th Information Technology and Mechatronics Enginee-ring Conference(ITOEC).IEEE,2018:1858-1862.
[7]LIU X D,JIN Y,SONG Y H,et al.Queue-Waiting-Time Based Load Balancing Algorithm for Fine-Grain Microservices[C]//International Conference on Services Computing.Cham:Sprin-ger,2018:176-191.
[8]CUI J,CHEN P,YU G.A Learning-based Dynamic Load Balancing Approach for Microservice Systems in Multi-cloud Environment[C]//2020 IEEE 26th International Conference on Parallel and Distributed Systems(ICPADS).IEEE,2020:334-341.
[9]CAPORUSCIO M,TOMA M D,MUCCINI H,et al.A Machine Learning Approach to Service Discovery for Microservice Architectures[C]//European Conference on Software Architecture.Cham:Springer,2021:66-82.
[10]YI C.Research on Microservice Cluster Load Balancing Technology[D].Dalian:Dalian Maritime University,2019.
[11]DONG X,YU Z,CAO W,et al.A Survey on Ensemble Learning[J].Frontiers of Computer Science,2020,14(2):241-258.
[12]CUTLER A,CUTLER D R,STEVENS J R.Random forests[M]//Ensemble Machine Learning.Boston,MA:Springer,2012:157-175.
[13]RAO H,SHI X,RODRIGUE A K,et al.Feature selection based on artificial bee colony and gradient boosting decision tree[J].Applied Soft Computing,2019,74:634-642.
[14]CHEN T,HE T,BENESTY M,et al.Xgboost:extreme gradient boosting[J].R package version 0.4-2,2015,1(4):1-4.
[15]2021:Alibaba Cloud Product[EB/OL].https://www.alibabacloud.com/product.
[16]LUO S,XU H,LU C,et al.Characterizing Microservice Depen-dency and Performance:Alibaba Trace Analysis[C]//Procee-dings of the ACM Symposium on Cloud Computing.2021:412-426.
[17]MATAM S,JAIN J.Pro Apache JMeter:web application performance testing[M].Apress,2017.
[18]JIN P,HAO X,WANG X,et al.Energy-efficient task scheduling for CPU-intensive streaming jobs on Hadoop[J].IEEE Transactions on Parallel and Distributed Systems,2018,30(6):1298-1311.
[19]FERREIRA DA SILVA R,ORGERIE A C,CASANOVA H,et al.Accurately Simulating Energy Consumption of I/O-intensive Scientific Workflows[C]//International Conference on Computational Science.Cham:Springer,2019:138-152.
[1] 陈自强, 夏正友.
一种拥塞避免的SDN单链路故障恢复模型
Failure Recovery Model for Single Link with Congestion-Avoidance in SDN
计算机科学, 2023, 50(4): 212-219. https://doi.org/10.11896/jsjkx.220300184
[2] 胡中源, 薛羽, 查加杰.
演化循环神经网络研究综述
Survey on Evolutionary Recurrent Neural Networks
计算机科学, 2023, 50(3): 254-265. https://doi.org/10.11896/jsjkx.220600007
[3] 林夕, 陈孜卓, 王中卿.
基于不平衡数据与集成学习的属性级情感分类
Aspect-level Sentiment Classification Based on Imbalanced Data and Ensemble Learning
计算机科学, 2022, 49(6A): 144-149. https://doi.org/10.11896/jsjkx.210500205
[4] 康雁, 吴志伟, 寇勇奇, 张兰, 谢思宇, 李浩.
融合Bert和图卷积的深度集成学习软件需求分类
Deep Integrated Learning Software Requirement Classification Fusing Bert and Graph Convolution
计算机科学, 2022, 49(6A): 150-158. https://doi.org/10.11896/jsjkx.210500065
[5] 孙福权, 梁莹.
基于XGBoost算法的水稻基因组6mA位点识别研究
Identification of 6mA Sites in Rice Genome Based on XGBoost Algorithm
计算机科学, 2022, 49(6A): 309-313. https://doi.org/10.11896/jsjkx.210700262
[6] 田真真, 蒋维, 郑炳旭, 孟利民.
基于服务器集群的负载均衡优化调度算法
Load Balancing Optimization Scheduling Algorithm Based on Server Cluster
计算机科学, 2022, 49(6A): 639-644. https://doi.org/10.11896/jsjkx.210800071
[7] 王宇飞, 陈文.
基于DECORATE集成学习与置信度评估的Tri-training算法
Tri-training Algorithm Based on DECORATE Ensemble Learning and Credibility Assessment
计算机科学, 2022, 49(6): 127-133. https://doi.org/10.11896/jsjkx.211100043
[8] 韩红旗, 冉亚鑫, 张运良, 桂婕, 高雄, 易梦琳.
基于共同子空间分类学习的跨媒体检索研究
Study on Cross-media Information Retrieval Based on Common Subspace Classification Learning
计算机科学, 2022, 49(5): 33-42. https://doi.org/10.11896/jsjkx.210200157
[9] 李京泰, 王晓丹.
基于代价敏感激活函数XGBoost的不平衡数据分类方法
XGBoost for Imbalanced Data Based on Cost-sensitive Activation Function
计算机科学, 2022, 49(5): 135-143. https://doi.org/10.11896/jsjkx.210400064
[10] 高捷, 刘沙, 黄则强, 郑天宇, 刘鑫, 漆锋滨.
基于国产众核处理器的深度神经网络算子加速库优化
Deep Neural Network Operator Acceleration Library Optimization Based on Domestic Many-core Processor
计算机科学, 2022, 49(5): 355-362. https://doi.org/10.11896/jsjkx.210500226
[11] 任首朋, 李劲, 王静茹, 岳昆.
基于集成回归决策树的lncRNA-疾病关联预测方法
Ensemble Regression Decision Trees-based lncRNA-disease Association Prediction
计算机科学, 2022, 49(2): 265-271. https://doi.org/10.11896/jsjkx.201100132
[12] 陈伟, 李杭, 李维华.
核小体定位预测的集成学习方法
Ensemble Learning Method for Nucleosome Localization Prediction
计算机科学, 2022, 49(2): 285-291. https://doi.org/10.11896/jsjkx.201100195
[13] 谭双杰, 林宝军, 刘迎春, 赵帅.
基于机器学习的分布式星载RTs系统负载调度算法
Load Scheduling Algorithm for Distributed On-board RTs System Based on Machine Learning
计算机科学, 2022, 49(2): 336-341. https://doi.org/10.11896/jsjkx.201200126
[14] 王博, 华庆一, 舒新峰.
基于云平台日志的故障检测和复杂构件系统即时可靠性度量研究
Study on Anomaly Detection and Real-time Reliability Evaluation of Complex Component System Based on Log of Cloud Platform
计算机科学, 2022, 49(12): 125-135. https://doi.org/10.11896/jsjkx.220200106
[15] 廖彬, 王志宁, 李敏, 孙瑞娜.
融合XGBoost与SHAP模型的足球运动员身价预测及特征分析方法
Integrating XGBoost and SHAP Model for Football Player Value Prediction and Characteristic Analysis
计算机科学, 2022, 49(12): 195-204. https://doi.org/10.11896/jsjkx.210600029
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!