Skip to content

Commit

Permalink
Apply FallbackTag to leastping and roundrobin
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhan6665 committed Mar 15, 2024
1 parent 5c41292 commit 69e1734
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions app/router/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,17 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
switch strings.ToLower(br.Strategy) {
case "leastping":
return &Balancer{
selectors: br.OutboundSelector,
strategy: &LeastPingStrategy{},
ohm: ohm,
selectors: br.OutboundSelector,
strategy: &LeastPingStrategy{},
fallbackTag: br.FallbackTag,
ohm: ohm,
}, nil
case "roundrobin":
return &Balancer{
selectors: br.OutboundSelector,
strategy: &RoundRobinStrategy{},
ohm: ohm,
selectors: br.OutboundSelector,
strategy: &RoundRobinStrategy{},
fallbackTag: br.FallbackTag,
ohm: ohm,
}, nil
case "leastload":
i, err := br.StrategySettings.GetInstance()
Expand All @@ -147,17 +149,19 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
}
leastLoadStrategy := NewLeastLoadStrategy(s)
return &Balancer{
selectors: br.OutboundSelector,
ohm: ohm, fallbackTag: br.FallbackTag,
strategy: leastLoadStrategy,
selectors: br.OutboundSelector,
ohm: ohm,
fallbackTag: br.FallbackTag,
strategy: leastLoadStrategy,
}, nil
case "random":
fallthrough
case "":
return &Balancer{
selectors: br.OutboundSelector,
ohm: ohm, fallbackTag: br.FallbackTag,
strategy: &RandomStrategy{},
selectors: br.OutboundSelector,
ohm: ohm,
fallbackTag: br.FallbackTag,
strategy: &RandomStrategy{},
}, nil
default:
return nil, newError("unrecognized balancer type")
Expand Down

4 comments on commit 69e1734

@BI7PRK
Copy link

@BI7PRK BI7PRK commented on 69e1734 Mar 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&Balancer {
fallbackTag: “”
}

不是这样配置的吗?

	"burstObservatory": {
		+ "fallbackTag": "proxy_s0", 
		"pingConfig": {
			"destination": "https://www.gstatic.com/generate_204",
			"interval": "2m",
			"timeout": "15s",
			"connectivity": "http://connectivitycheck.platform.hicloud.com/generate_204",
			"sampling": 2
		},
		"subjectSelector": [
			"proxy_"
		]
	}

@yuhan6665
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是啊 路由里面的 #2999 (comment)

@BI7PRK
Copy link

@BI7PRK BI7PRK commented on 69e1734 Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大佬辛苦啦!
升v1.8.9后,油管速率上总是上不去,排查不出什么原因。然后升级到 这个代码版本后,速率就彪升了。不知道是不是 v1.8.9 有什么暗病。

@ZqinKing
Copy link

@ZqinKing ZqinKing commented on 69e1734 Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大佬辛苦啦! 升v1.8.9后,油管速率上总是上不去,排查不出什么原因。然后升级到 这个代码版本后,速率就彪升了。不知道是不是 v1.8.9 有什么暗病。

线路问题吧,用的relese的1.8.9。油管一直有20W+

Please sign in to comment.