Better server selection client code?

Brad Fitzpatrick brad at
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.
> > ( )
> 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, "" and $point_number is 1..50.

I'm eager to get this into the Perl library.

- Brad

More information about the memcached mailing list