IP Upstream Hash
matthieu.tourne at gmail.com
Wed Jul 20 21:18:52 UTC 2011
I was looking at the code in ngx_http_upstream_ip_hash_module.c
And I'm not sure where the hashing algorithm for IPs is coming from,
especially those lines :
iphp->hash = 89;
hash = (hash * 113 + iphp->addr[i]) % 6271;
Just wondering if those constants are arbitrary chosen, or if there is
something there to guarantee a good distribution ?
If you have some links explaining this algorithm, it would be greatly
Also, how would you get a good distribution on IPv6. Maybe it would make
sense to use murmur ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx-devel