Skip to content

Commit

Permalink
Merge pull request #131 from caozhipan/fix-activeQPS-zero
Browse files Browse the repository at this point in the history
解决activeQPS=0
  • Loading branch information
zhangxu19830126 committed May 7, 2019
2 parents fc6f4b8 + 990cced commit e5c7b88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/proxy/dispatcher_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,14 @@ func (r *dispatcher) refreshAllQPS() {
}

func (r *dispatcher) refreshQPS(value int64) int64 {
activeQPS := value
if len(r.proxies) > 0 {
return value / int64(len(r.proxies))
activeQPS = value / int64(len(r.proxies))
}
return value
if activeQPS <= 0 {
activeQPS = 1
}
return activeQPS
}

func (r *dispatcher) addServer(svr *metapb.Server) error {
Expand Down

0 comments on commit e5c7b88

Please sign in to comment.