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])
Same question about adding a instance - must i add it to the end of
the list to lose the least amount of keys?
Theoretically, one would expect to lose ~10% when adding or removing
using consistent hashing as the angels of the circles expand/contract,
correct?
I guess it all depends on how the client utilizes buckets used to
calculate the hash per machine.. no?
also, I would love to hear how you guys handling adding/removing
servers from your production ...
Thanks in advance for any help and clarifications!
Ken.