Multiple memcached servers question.
- by Andre
hypothetically - if I have multiple memcached servers like this:
//PHP
$MEMCACHE_SERVERS = array(
"10.1.1.1", //web1
"10.1.1.2", //web2
"10.1.1.3", //web3
);
$memcache = new Memcache();
foreach($MEMCACHE_SERVERS as $server){
$memcache->addServer ( $server );
}
And then I set data like this:
$huge_data_for_frong_page = 'some data blah blah blah';
$memcache->set("huge_data_for_frong_page", $huge_data_for_frong_page);
And then I retrieve data like this:
$huge_data_for_frong_page = $memcache->get("huge_data_for_frong_page");
When i would to retrieve this data from memcached servers - how would php memcached client know which server to query for this data? Or is memcached client going to query all memcached servers?