• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science ›› 2020, Vol. 42 ›› Issue (08): 1339-1344.

Previous Articles     Next Articles

Load balancing optimization of consistent hashing  microservice based on dynamic weight

ZHANG Kai-qi1,LIU Xiao-yan1,WANG Xin1,JI Chun-shan2,YAN Xin1   

  1. (1.Faculty of Information Engineering and Automation,Kunming University of Science and Technology,Kunming 650500;

    2.Jinchuan Nickel Drill Research and Design Institute,Jinchang 737110,China)

  • Received:2020-01-09 Revised:2020-04-16 Accepted:2020-08-25 Online:2020-08-25 Published:2020-08-29

Abstract: With the development of Internet technology, the load capacity of Internet server clusters is facing unprecedented challenges, and it is particularly important to implement a reasonable load balancing strategy. In order to achieve the best efficiency for load balancing, a consistent hash algorithm is adopted to distribute the loads of the load balancing system into a cluster. This paper analyzes the characteristics of load balancing in a cluster of servers based on microservice architecture, and proposes a method for designing and segmenting a consistent hash ring based on virtual nodes and a dynamic weight-based allocation strategy. Based on the consistent hash algorithm, load transfer between service clusters is achieved to solve the problem of load imbalance between services caused by increased service load in microservice clusters. It can prevent some services from crashing due to excessive load pressure. The experiments show that the improved load balancing strategy only has 31% load imbalance probability of the traditional consistency algorithm, and the dynamic allocation strategy has good load balancing performance, and can effectively solve the load balancing problem of microservices distributed architecture.

Key words: microservice, consistent hashing, load balancing, dynamic weight