mochengqian commented on PR #928:
URL: https://github.com/apache/dubbo-go-pixiu/pull/928#issuecomment-4527754856
@AlexStocks Alex pls review. 简单说,当前这套设计主要参考了这三层:
1. **Maglev 原始算法**
- 用 prime table size、`offset + skip`、permutation 填表这一套。
- Pixiu 这次 PR 里的 `generatePerm / populate` 就是这个思路。
2. **成熟网关的一致性哈希实现**
- Envoy 的 Maglev / RingHash:稳定 hash + 快速 hash(`xxHash64`、`MurmurHash2`)。
- HAProxy / OpenResty / APISIX:也是“快、稳定、分布好”,不走重型加密 hash。
3. **Pixiu 自己的兼容思路**
- Maglev 不可用时回退 ringhash,保证能跑。
- 现在的争议点主要在“request path 上用什么 hash 最划算”。
一句话总结:**参考的是“标准 Maglev + 业界快速确定性 hash”的路线**
参考:
- [Envoy
Maglev](https://github.com/envoyproxy/envoy/blob/main/source/extensions/load_balancing_policies/maglev/maglev_lb.cc#L138-L139)
- [HAProxy hashing
internals](https://github.com/haproxy/haproxy/blob/master/doc/internals/hashing.txt#L13-L38)
- [APISIX
chash](https://github.com/apache/apisix/blob/master/apisix/balancer/chash.lua#L18-L24)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]