From: Lionel Bouton Date: 2007-07-18T05:18:18+09:00 Subject: Re: memcache C extension snacktime wrote the following on 17.07.2007 21:45 : > I've decided I want to become more proficient in C, so the project is > chose is a ruby memcache C extension. I found the following site with > a hash algorithm that seems to be an improvement on the default on, > can anyone think of a reason why not to use this? > > http://www.last.fm/user/RJ/journal/2007/04/10/392555/ - very poor distribution with few servers, - no control of weight between servers (ie if I have a memcache server with 2GB and one with 128MB, nothing prevents the second from getting 10 times as much access as the first one...). This algorithm benefits very large server farms with identical server configurations where having poor performance over a small part of the cache isn't a big deal. If you want both good controlled distribution and high cache hits with low number of servers, on first thought I'll implement a double query system where cache clients are responsible for moving data accross servers based on an old configuration and a new one. When the hit rate ratio on the new configuration is good and bad on the old one, deactivate queries on the old configuration. Assuming 2 gets and a put to memcache servers are faster than direct access to the data, this is probably a win. With that kind of system you could even handle server failures automatically by creating new configurations on the fly (and using hit ratio stats from the two previous configuration to decide which one is the better new 'old one'). But then again it's only a first thought :-) Lionel.