IP Upstream Hash

Oscar Fernandez oscaretu at gmail.com
Thu Aug 4 07:08:15 UTC 2011


According to

 http://code.google.com/p/smhasher/

murmur3 is better than murmur2

Oscar

On Thu, Aug 4, 2011 at 3:47 AM, chateau Xiao <chateau.xiao at gmail.com> wrote:

> do you mean, in the next version, murmur2 hash function will be used in
> nginx?
>
> and do you show the benchmark between the orignial algorithm and the new
> one?
>
> On Thu, Jul 21, 2011 at 5:43 PM, Igor Sysoev <igor at sysoev.ru> wrote:
>
>> On Wed, Jul 20, 2011 at 02:18:52PM -0700, Matthieu Tourne wrote:
>> > Hi all,
>> >
>> > 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
>> > appreciated!
>> > Also, how would you get a good distribution on IPv6. Maybe it would make
>> > sense to use murmur ?
>>
>> This algorithm came from FastMail.fm. Murmur2 may be better, I'm going
>> to use it in upcoming upstream hash module which allows to hash any
>> expression.
>>
>>
>> --
>> Igor Sysoev
>>
>> _______________________________________________
>> nginx-devel mailing list
>> nginx-devel at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>>
>
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
>


-- 
Oscar Fernandez Sierra
oscaretu at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20110804/5cc206ef/attachment.html>


More information about the nginx-devel mailing list