Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the fault-tolerant strategy and dynamic agent strategy of dubbo cluster

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the fault-tolerant strategy and dynamic agent strategy of dubbo cluster". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the dubbo cluster fault tolerance strategy and dynamic agent strategy"?

Dubbo load balancing Strategy random loadbalance

By default, dubbo is randomly called by random load balance to achieve load balancing. You can set different weights for different instances of provider, and load balancers will be balanced according to the weights. The higher the weight, the higher the traffic distribution. Generally, you can use this default one.

Roundrobin loadbalance

The default is to evenly send traffic to each machine, but if the performance of each machine is different, it is easy to cause the poor performance machine to be overloaded. So we need to adjust the weight at this time, so that the load-bearing weight of the machine with poor performance is smaller and the flow is less.

Give me a chestnut.

Sometimes, we are lucky to apply for machines with our operation and maintenance classmate. We happen to have sufficient resources. Just now, a batch of steaming virtual machines have just been released, and the configuration is relatively high: 8 cores + 16G machines, and we have applied for 2 machines. After a while, we felt that the two machines were not enough, so I went to the operation and maintenance classmate and said, "Brother, can you give me another machine?" but there was only a 4-core + 8G machine left. I still have to take it.

At this time, you can set the weight 4 for two 8-core 16G machines and 2 for the remaining 4-core 8G machines.

Leastactive loadbalance

This is automatic perception that the worse the performance of a machine, the less requests it receives and the less active it will give less requests to inactive machines with poor performance.

Consistanthash loadbalance

Consistent Hash algorithm: requests with the same parameters must be distributed to a provider. When the provider dies, the remaining traffic will be evenly distributed based on the virtual node, and the jitter will not be too great. If what you need is not random load balancing, but one class of requests to one node, then follow this consistent Hash strategy.

Fault tolerance Strategy of dubbo Cluster

Failover cluster mode

Fail to switch automatically and automatically retry other machines. This is the default, which is common in read operations. (failed to retry other machines)

Failfast cluster mode

A call fails immediately, which is common in write operations. (immediately fails if the call fails)

Failsafe cluster mode

Ignored when an exception occurs, and is often used for unimportant interface calls, such as logging.

Failback cluster mode

Failed background automatically record the request, and then resend regularly, which is more suitable for writing message queues.

Forking cluster mode

Multiple provider are called in parallel, and as soon as one succeeds, it returns immediately.

Broadcacst cluster

Call all the provider one by one.

Dubbo dynamic agent strategy

Javassist dynamic bytecode generation is used by default to create a proxy class. However, you can configure your own dynamic proxy policy through the spi extension mechanism.

At this point, I believe you have a deeper understanding of "dubbo cluster fault tolerance strategy and dynamic agent strategy". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report