hash algorithm for nginx cache

Igor Sysoev is at rambler-co.ru
Sat May 16 19:38:25 MSD 2009


On Fri, May 15, 2009 at 07:29:57AM +0200, Joe Bofh wrote:

> Igor,
> 
> Sure. But the question is how long will the entry stay in the cache? If 
> it's a fairly finite amount of time, the possibility of a collision 
> drops dramatically.

A cache entry may stay for years :)

> I was suggesting murmurhash as it is significantly faster than md5/sha1 
> and for something like a object, the cryptographic requirements are 
> simply not there (i.e. the cached object does not need to be encrypted).

As to speed, benchmarks usually test algorithms with preloaded cache,
but in real life code works with non cached data and memory latency
descreases difference.

> If there is concern over collisions, something like a bloom filter or a 
> cuckoo hash could be used. http://en.wikipedia.org/wiki/Cuckoo_hashing
> 
> --J
> 
> Igor Sysoev wrote:
> 
> > 
> > I'm not expert in cryptography, but it seems to me that 128-bit MD5
> > should have though not 2^64 times less collisions, but at least 10^9 
> > times
> > less than any 64-bit hash.
> 
> -- 
> Posted via http://www.ruby-forum.com/.

-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list