> Hi guys,
>
> I was wondering,
> If I have an array of 10 machines , 1 instance per machine set up like
> this:
>
> "instances" => array(
>                               "server1" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server2" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server3" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server4" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server5" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server6" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server7" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server8" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server9" => array("host" => "111.111.111.111", 
> "port" => "11211",
> "weight" => 6),
>                               "server10" => array("host" => 
> "111.111.111.111", "port" =>
> "11211", "weight" => 6)
>                       );
> [ip's ofcourse are foobar]
>
> I run through the array and through the (php) client I "addServer()"
> foreach of the values.
> The client is configured to have consistent hashing
>
> Then I want to take out a single instance (permanently).. but i want
> to take out server3 for example.
> Would i be loosing the same percent/amount of keys if i were to remove
> the last server in the list (server10) ?
> Or, since the entire list just went up (in order), would the client
> think that now 4, is in 3'rd place.. and would look for keys usually
> found on server 3, on machine 4? (and so forth and so forth going down
> the list, thus losing ~70% of keys [very bad])

I probably shouldn't answer this without researching your client (what
client are you using exactly?), but for consistent hashing it's supposed
to sort the server list first... I'm pretty sure?

So you sort the supplied server list, then hash it out onto the big wheel.
Which makes adding/removing servers not expand or contract the final hash
table but instead shift around the areas where the sorted server would be
inserted or removed.

Reply via email to