Anatomy of Dubbo - Load Balancing

I. Introduction

When the service provider is a cluster, in order to prevent a large number of requests from falling to one or several service provider machines all the time, so that these machines have a high load or even kill them, a certain load balancing strategy needs to be implemented. Dubbo provides a variety of balancing strategies, the default is random random call

2. Dubbo load balancing strategy

  • Random LoadBalance Random strategy Set random probability
    by weight.
  • RoundRobin LoadBalance Polling strategy
    Round Robin , set the round robin ratio according to the weight after the convention
  • LeastActive LoadBalance Minimum number of active
    calls The least number of active calls, random for the same active number, active number refers to the difference between the counts before and after the call
  • ConsistentHash LoadBalance Consistent hash strategy
    Consistent Hash, requests with the same parameters are always sent to the same provider.
    When a certain provider hangs, the request originally sent to the provider will be spread to other providers based on virtual nodes, and will not cause drastic changes.

3. When to load the load balancing strategy

image.png

4. Summary

Dubbo provides several common load balancing strategies. If you need to customize your own load balancing strategy, you can customize it according to dubbo's specifications. For example, you can customize the uniform consistency hash to improve the consistency hash of dubbo.

Welcome everyone to join WeChat scan code to enter the knowledge planet for in-depth discussion
121、.png

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325781522&siteId=291194637