Consistent hashing libraries

xuanbao · · 330 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;ve been using the <a href="http://github.com/stathat/consistent" rel="nofollow">stathat</a> library and have found that it does not do a good job of evenly distributing keys.</p> <p>When using two nodes it yields fairly decent results but as soon as you add a third it converts to be heavily lopsided:</p> <p>A - 25% B - 20% C - 55%</p> <p>Ideally it would want to be as close to 33% per node as possible. Does anyone know what a good replacement might be? </p> <p>Thanks</p> <hr/>**评论:**<br/><br/>netingle: <pre><p>We started with the stathat one but ending up pretty much completely rewriting it: <a href="https://github.com/weaveworks/cortex/blob/master/ring/ring.go" rel="nofollow">https://github.com/weaveworks/cortex/blob/master/ring/ring.go</a></p> <p>Does &#34;virtual nodes&#34; for better load balancing - the more tokens per node you add, the better load balancing you get.</p> <p>Edit: heres the current load balancing on our dev cluster - <a href="http://imgur.com/a/swwSP" rel="nofollow">http://imgur.com/a/swwSP</a></p></pre>nastus: <pre><p>Thanks! I&#39;ll take a good look at it later tonight and see if it will fit the bill</p></pre>gohacker: <pre><p><a href="https://github.com/dgryski/go-jump" rel="nofollow">https://github.com/dgryski/go-jump</a></p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

330 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传