Better server selection client code?
brad at danga.com
Mon Nov 6 19:32:27 UTC 2006
On Mon, 6 Nov 2006, Andrew Harbick wrote:
> > Even I had suggested a deterministic way of picking a point, which was
> > based on the largest available free arc on the unit circle. But as
> > Andrew added, this will distribute load uniform only when the number of
> > servers are a power of 2.
> > (http://lists.danga.com/pipermail/memcached/2006-October/002940.html )
> Right, what my client didn't do at the time was to place
> (deterministically) any one server in multiple places on the unit
> circle. I was placing each server in only one place on the unit circle.
> Imagine using a bunch of different hashes to put one server at different
> spots on the circle, and then repeat that process with other servers.
> You'll get an even distribution of load and still be able to have only a
> few servers.
Yeah, it works well. I just hashed "$servername-$point_number" where
$servername is, say, "10.0.0.5:11211" and $point_number is 1..50.
I'm eager to get this into the Perl library.
More information about the memcached