You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/15 13:10:53 UTC
[GitHub] [dubbo-spi-extensions] 24kpure opened a new pull request #68: add PeakEwmaLoadBalance
24kpure opened a new pull request #68:
URL: https://github.com/apache/dubbo-spi-extensions/pull/68
## What is the purpose of the change
I am disappointment with shortestResponseLoadBalance,though it is better than others in latency spike. However, it’s slow for it depends on average.I am looking forwad to a sensitive loadbance.
PeakEwmaLoadBalance is designed to converge quickly when encountering slow endpoints.
It is quick to react to latency spikes recovering only cautiously.Peak EWMA takes history into account,so that slow behavior is penalized relative to the supplied `decayTime`.
Inspiration drawn from:[finagle](https://github.com/twitter/finagle/blob/1bc837c4feafc0096e43c0e98516a8e1c50c4421/finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/PeakEwma.scala)
## Brief changelog
- calculate cost by exponential moving averages
- add decayTime
- ignore invoker‘s weight
## Q&A
Q: Why decayTime default value is 10_000 ?
A: It's hard to find an appropriate default value, so refer to apisix first.
Q: Why does peakEwmaLoadBalance ignore weight?
A: PeakEwmaLoadBalance pays more attention to rt,as for weight,equal costs only appear in very few scenes. What's
more,the node weights are equal in most case, for instance, cloud native scene.Though dubbo works in different weight scene, active will help in traffic distribution.
Q: Why does it add lock to `observe`?
A: For calculating cost and updating some rt related parameters.
## note
We will have a try first and feed back to the community in time.
## Reference
[finagle](https://github.com/twitter/finagle/blob/1bc837c4feafc0096e43c0e98516a8e1c50c4421/finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/PeakEwma.scala)
[apisix](https://github.com/apache/apisix/blob/131998df4f44720b7ddf0424f4d381efb689d4ce/apisix/balancer/ewma.lua
)
[paper](http://www.eckner.com/papers/Algorithms%20for%20Unevenly%20Spaced%20Time%20Series.pdf)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo-spi-extensions] AlbumenJ commented on a change in pull request #68: add PeakEwmaLoadBalance
Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-spi-extensions/pull/68#discussion_r713188269
##########
File path: dubbo-cluster-extensions/dubbo-cluster-loadbalance-peakewma/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java
##########
@@ -0,0 +1,296 @@
+package org.apache.dubbo.rpc.cluster.loadbalance;/*
Review comment:
Also for this file
##########
File path: dubbo-cluster-extensions/dubbo-cluster-loadbalance-peakewma/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/AbstractLoadBalanceTest.java
##########
@@ -0,0 +1,81 @@
+package org.apache.dubbo.rpc.cluster.loadbalance;/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
Review comment:
ASF license should be started in the first line.
##########
File path: dubbo-cluster-extensions/dubbo-cluster-loadbalance-peakewma/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/PeakEwmaLoadBalanceTest.java
##########
@@ -0,0 +1,112 @@
+package org.apache.dubbo.rpc.cluster.loadbalance;/*
Review comment:
Also for this file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo-spi-extensions] codecov-commenter commented on pull request #68: add PeakEwmaLoadBalance
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #68:
URL: https://github.com/apache/dubbo-spi-extensions/pull/68#issuecomment-923029098
# [Codecov](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#68](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (663a848) into [master](https://codecov.io/gh/apache/dubbo-spi-extensions/commit/b100785a50e34f776c47e2941bc9103960651d85?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b100785) will **increase** coverage by `4.12%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68/graphs/tree.svg?width=650&height=150&src=pr&token=5VPNX1R1J7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #68 +/- ##
============================================
+ Coverage 36.80% 40.92% +4.12%
- Complexity 61 67 +6
============================================
Files 30 31 +1
Lines 644 689 +45
Branches 74 80 +6
============================================
+ Hits 237 282 +45
Misses 386 386
Partials 21 21
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...o/rpc/cluster/loadbalance/PeakEwmaLoadBalance.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tY2x1c3Rlci1leHRlbnNpb25zL2R1YmJvLWNsdXN0ZXItbG9hZGJhbGFuY2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9jbHVzdGVyL2xvYWRiYWxhbmNlL1BlYWtFd21hTG9hZEJhbGFuY2UuamF2YQ==) | `100.00% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b100785...663a848](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/68?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo-spi-extensions] 24kpure commented on a change in pull request #68: add PeakEwmaLoadBalance
Posted by GitBox <gi...@apache.org>.
24kpure commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-spi-extensions/pull/68#discussion_r712671264
##########
File path: dubbo-cluster-extensions/dubbo-cluster-loadbalance/pom.xml
##########
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>dubbo-cluster-extensions</artifactId>
+ <groupId>org.apache.dubbo.extensions</groupId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-cluster-loadbalance</artifactId>
Review comment:
Done ~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo-spi-extensions] AlbumenJ commented on a change in pull request #68: add PeakEwmaLoadBalance
Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-spi-extensions/pull/68#discussion_r712260993
##########
File path: dubbo-cluster-extensions/dubbo-cluster-loadbalance/pom.xml
##########
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>dubbo-cluster-extensions</artifactId>
+ <groupId>org.apache.dubbo.extensions</groupId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>dubbo-cluster-loadbalance</artifactId>
Review comment:
just named the module as `dubbo-cluster-loadbalance-peakewma`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo-spi-extensions] AlbumenJ merged pull request #68: add PeakEwmaLoadBalance
Posted by GitBox <gi...@apache.org>.
AlbumenJ merged pull request #68:
URL: https://github.com/apache/dubbo-spi-extensions/pull/68
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo-spi-extensions] 24kpure commented on a change in pull request #68: add PeakEwmaLoadBalance
Posted by GitBox <gi...@apache.org>.
24kpure commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-spi-extensions/pull/68#discussion_r713525490
##########
File path: dubbo-cluster-extensions/dubbo-cluster-loadbalance-peakewma/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/AbstractLoadBalanceTest.java
##########
@@ -0,0 +1,81 @@
+package org.apache.dubbo.rpc.cluster.loadbalance;/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
Review comment:
Three files have been processed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org