Ribbon几种负载均衡规则

3 篇文章 0 订阅
1 篇文章 0 订阅

1.轮询规则
RoundRobinRule
This rule simply choose servers by round robin. It is often used as the default rule or fallback of more advanced rules.

2.根据服务是否死掉或者服务处于高并发来分配权重
AvailabilityFilteringRule
This rule will skip servers that are deemed “circuit tripped” or with high concurrent connection count.
By default, an instance is circuit tripped if the RestClient fails to make a connection to it for the last three times. Once an instance is circuit tripped, it will remain in this state for 30 seconds before the circuit is deemed as closed again. However, if it continues to fail connections, it will become “circuit tripped” again and the wait time for it to become “circuit closed” will increase exponentially to the number of consecutive failures.
3.根据响应时间分配权重
WeightedResponseTimeRule
For this rule, each server is given a weight according to its average response time. The longer the response time, the less weight it will get. The rule randomly picks a server where the possibility is determined by server’s weight.
To enable WeightedResponseTimeRule, set it with the load balancer via API or set the following property
4.随机原则
RandomRule
5.配置方式:
在application.properties中添加:

service-B.ribbon.NFLoadBalancerRuleClassName=com.netflix.loadbalancer.RandomRule

service-B为application name

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

那年的夏天123

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值