You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "default233 (via GitHub)" <gi...@apache.org> on 2023/03/28 07:17:51 UTC

[GitHub] [dubbo] default233 opened a new issue, #11947: ConsistentHashLoadBalance hash不稳定

default233 opened a new issue, #11947:
URL: https://github.com/apache/dubbo/issues/11947

   ConsistentHashLoadBalance
   一致性hash 负载均衡策略,在 2.7.22 版本中新增一段算法保证负载策略更均衡,经测试在provider节点数量稳定的场景下,无法保证 同一 hashKey 能够 hash 到同一 provider 节点,如果希望负载更均衡,个人认为不应该选择一致性 hash 策略,是否应该优先保证稳定场景下的 hash 稳定,或是我个人用法有误,望大佬指点
               double overloadThread = ((double) totalRequestCount.get() / (double) serverCount) * OVERLOAD_RATIO_THREAD;
               /**
                * Find a valid server node:
                * 1. Not have accept request yet
                * or
                * 2. Not have overloaded (request count already accept < thread (average request count * overloadRatioAllowed ))
                */
               while (serverRequestCountMap.containsKey(serverAddress)
                       && serverRequestCountMap.get(serverAddress).get() >= overloadThread) {
                   /**
                    * If server node is not valid, get next node
                    */
                   entry = getNextInvokerNode(virtualInvokers, entry);
                   serverAddress = entry.getValue().getUrl().getAddress();
               }
               if (!serverRequestCountMap.containsKey(serverAddress)) {
                   serverRequestCountMap.put(serverAddress, new AtomicLong(1));
               } else {
                   serverRequestCountMap.get(serverAddress).incrementAndGet();
               }
               totalRequestCount.incrementAndGet();


-- 
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.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] AlbumenJ closed issue #11947: ConsistentHashLoadBalance hash不稳定

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed issue #11947: ConsistentHashLoadBalance hash不稳定
URL: https://github.com/apache/dubbo/issues/11947


-- 
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] AlbumenJ commented on issue #11947: ConsistentHashLoadBalance hash不稳定

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #11947:
URL: https://github.com/apache/dubbo/issues/11947#issuecomment-1486452998

   2.7.x 目前已经只有安全维护了,在最近也将 EOL 了,我们建议所有的用户都升级到 3.1.x 最新版本上


-- 
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] default233 commented on issue #11947: ConsistentHashLoadBalance hash不稳定

Posted by "default233 (via GitHub)" <gi...@apache.org>.
default233 commented on issue #11947:
URL: https://github.com/apache/dubbo/issues/11947#issuecomment-1486418051

   > 
   
   3.1.8 是可以的,后续 2.7.x的版本还会调整这块的逻辑么


-- 
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] default233 commented on issue #11947: ConsistentHashLoadBalance hash不稳定

Posted by "default233 (via GitHub)" <gi...@apache.org>.
default233 commented on issue #11947:
URL: https://github.com/apache/dubbo/issues/11947#issuecomment-1486459451

   > serverRequestCountMap
   
   好的,多谢🙏


-- 
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] AlbumenJ commented on issue #11947: ConsistentHashLoadBalance hash不稳定

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #11947:
URL: https://github.com/apache/dubbo/issues/11947#issuecomment-1486403609

   看一下最新的 3.1.8 的一致性哈希是不是有问题


-- 
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


Re: [I] ConsistentHashLoadBalance hash不稳定 [dubbo]

Posted by "edhn3000 (via GitHub)" <gi...@apache.org>.
edhn3000 commented on issue #11947:
URL: https://github.com/apache/dubbo/issues/11947#issuecomment-2362837559

   mark,dubbo 2.7.x 遇到此问题,一致性hash应该按照hashkey负载到同一个节点,2.7用一个OVERLOAD_RATIO_THREAD定义来控制负载量,猜想可能是为了更加可用,但是违背了一致性哈希的意图,主要是造成理解不一致,最终影响了一致性效果。看了下3.1.x最新的确去掉了此实现,2.7修复的话我这边是覆盖了此类,虽然觉得2.7也应该修复此问题


-- 
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