You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "shawnh2 (via GitHub)" <gi...@apache.org> on 2023/04/06 09:38:44 UTC

[GitHub] [dubbo-go-pixiu] shawnh2 commented on pull request #554: Add Maglev hashing LB algorithm

shawnh2 commented on PR #554:
URL: https://github.com/apache/dubbo-go-pixiu/pull/554#issuecomment-1498772806

   > 分配好像不均衡,result `map[1:6 2:2 3:4 4:5 5:3]`
   
   maglev hash 算法要求的是 LookUpTable 的表长度(也就是其结构体内 size 字段的值)必须是个质数,这样可以保证均衡。
   
   但在目前的实现中,这一点我没有去保证,我来补充一下。
   
   当然,还有一点,就是目前的 hash 函数不是一个随机 hash,这就导致上述代码每次运行结果都一样,这个问题我也解决一下。


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