Hash Function

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Oct 22 09:15:01 CEST 2007


In message <29f77e8a0710212328t5a33040cq2f57b0f312b64ee at mail.gmail.com>, "Luke 
Macpherson" writes:
>My understanding from a cursory read of the source is that Varnish is
>using crc32 as a hash function.

The hash code, function as well as data structure is a pluggable
module in Varnish, so changes in this area is anticipated.

The default "simple" hasher, uses a single hash-table and crc32
for and it doesn't work too badly for even quite large workloads.

The important property of the hashing module in Varnish is that the
hashing function distributes fast at the first level of locks, so
that other threads can get in as well.  The actual length of the
hash-buckets seems to be of little consequence.

At least so far.

Some day when the requirement (and time) manifests itself, I want
to add a hash module which scales to infinity (ie: 64 bits) and
that will probably be an adaptive multi-level tree structure of
hashes with MD4 as a distributor function.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list