Better server selection client code?

Jeetendra Mirchandani jeetum at gmail.com
Mon Nov 6 17:35:05 UTC 2006


On Fri, 2006-11-03 at 22:10 +0000, Brad Fitzpatrick wrote:

> And here's a perl implementation of consistent hashing I just did now, for
> inclusion into Cache::Memcached:
> 
>    http://code.sixapart.com/svn/memcached/trunk/api/perl/dev/cons-hash.pl
> 
> Seems to work really well, and will solve a lot of operational problems we
> have when changing our memcached farm's layout.

Consistent hashing has a shortcoming of not distributing load evenly.
Some cases require the number of servers to be a power of 2 always to
have perfect distribution of load!

The paper mentions of keeping more than one copy to counter this. But
then, keeping more copies is equivalent to loosing half my machines :-O

Moreover, bad load distribution will also lead to a lower cache hit
ratio.

In short, this will be useful(correct) only if you have a large number
of instances/machines!

Thanks,
Jeetu

> 
> This will be optional in future versions of Cache::Memcached.  There will
> be some way to opt-in to the consistent hashing behavior, but it'll
> probably be the documented/recommended way.  But I won't change the
> current syntax for the old way.
> 
> - Brad
> 



More information about the memcached mailing list