On Tue, 2006-03-28 at 23:25 +0100, Matthias Scheler wrote: > On Tue, Mar 28, 2006 at 11:49:24PM +0300, Ranko Zivojnovic wrote: > > True - the mistake was in the typecast, but I still want to use 32 > bit > > values in the hash calculus in order to allow for the large hash > table. > > Linux and others do provide for s6_addr32, but Solaris 8 > unfortunately > > does not (for user space at least) - thus the cast. If you have > better > > or more portable solution, please do let me know. > > Run a standard byte string hash function over the full IPv6 address. > Your assumption that the last 32bit of an IPv6 address provide a good > hash key is not true in a lot of cases anyway (e.g. for statically > assigned IPv6 addresses). Some tests I've done show that the current hash function does pretty good job distributing records across buckets. Originally, before I have published any patches, I've only used the IP as a bucket reference. The distribution was not really satisfactory as certain buckets would hold a lot of records. This was because one bucket would hold for example ALL the records coming from one regular mail server - which can be really a lot. This is when I have added some "salt" to the equation which also takes into consideration first two characters of both sender and recipient. The distribution then evened across the buckets. The same "salt" trick is used for both IPv4 and IPv6 thus I cannot really see any obvious need to change the current algorithm. Best regards, Ranko
Message
Re: [milter-greylist] hash table acceleration breaks lazyaw
2006-03-30 by Ranko Zivojnovic
Attachments
- No local attachments were found for this message.