计算机科学 ›› 2024, Vol. 51 ›› Issue (6): 346-353.doi: 10.11896/jsjkx.231100125
郑旭1, 范红杰2, 柳军飞3
ZHENG Xu1, FAN Hongjie2, LIU Junfei3
摘要: 在分布式架构下,同时存在于多个节点的限流器需要很好地协作才能达到单体限流的效果。 在真实的业务场景中,线上请求分布不规律,线下业务吞吐量大。在此情况下,某一些关键节点因为超负荷运作而响应缓慢,从而导致请求链路整体的延迟增加,甚至造成整个应用的反应迟缓。针对现有微服务限流所存在的问题,文中提出了一种基于预分配额度进行主动推送配额更新的限流算法。该算法采用服务器主动向客户端广播的模式,服务器既可以接受客户端请求,也可以主动更新持有该资源配额的节点在处理请求后的最新结果。在服务器端分配所有节点配额时,可以采用灵活的分配算法进行分配。在估算限流节点配额时,采用滑动窗口的模式记录下一段时间内的请求数量和拥有的资源配额,通过自定义的算法来预估下一个周期的配额。同时,文中基于该算法实现了一个限流模型。实验结果证明,该模型可以及时地响应配额的变化,很好地实现节点之间的公平性。相比Doorman系统,所提模型可以更好地适应线上线下流量场景和精准限流。
中图分类号:
[1]ALSHUQUYRAN N,ALI N,EVANS R.A systematic mapping study in microservice architecture[C]//2016 IEEE 9th International Conference on Service-Oriented Computing and Applications.IEEE,2016:44-51. [2]SHANG P M,CHEN Y F,YEN C,et al.Using service depen-dency graph to analyze and test microservices[C]//2018 IEEE 42nd Annual Computer Software and Applications Conference.2018:81-86. [3]PATIL R Y,RAGHA L.A rate limiting mechanism for defending against flooding based distributed denial of service attack[C]//2011 World Congress on Information and Communication Technologies.IEEE,2011:182-186. [4]VISSER J.YouTube Doorman[EB/OL].[2015-01-03].ht-tps://github.com/youtube/doorman. [5]TEAM T P.Polaris Mesh[EB/OL].https://polarismesh.cn/zh/doc/%E5%8C%97 %E6%9E%81%E6%98%9F%E6%98%AF%E4%BB%80%E4%B9%88/%E7%AE%80%E4%BB%8B.html. [6]WANG T,ZHANG W B,XU J W,et al.A survey of fault detection for distributed software systems with statistical monitoring in cloud computing[J].Chinese Journal of Computers,2017,40(2):397-413. [7]LI S S,RONG G P,GAO Q Y,et al.Optimized dataflow-driven approach for microservices-oriented decomposition[J].Journal of Software,2021,32(5):1284-1301. [8]ALESSANDRA L,RICARDO T,MARCO T V.Towards atechnique for extracting microservices from monolithic enterprise Systems[C]//2016 Conference on Brazilian Workshop on Software Visualization,Evolution and Maintenance.2016,97-104. [9]ZHU H Q,MA W B,ZHOU H H,et al.Microservices user requests allocation strategy based on improved multi-objective evo-lutionary algorithms[J].Computer Science,2021,48(10):343-350. [10]YANG Q L,JIANG L Y.Study on load balancing algorithm of microservices based on machine learning[J].Computer Science,2023,50(5):313-321. [11]JIANG Z,WANG J L,CAO R H,et al.Method of service decomposition based on microservice architecture[J].Computer Science,2021,48(12):17-23. [12]BARTKOV M,BOROVIKOV D.Selection of a suitable algorithm for the implementation of rate limiter based on bucket4j[J].International Journal of Online & Biomedical Engineering,2022,16(4):52-63. [13]AHMADVAND H,DARGAHI T,FOROUTAN F,et al.Bigdata processing at the edge with data skew aware resource allocation[C]//2021 IEEE Conference on Network Function Virtua-lization and Software Defined Networks.2021:81-86. |
|