计算机科学 ›› 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.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!