php - How to delete memcached key set by another web server -
php - How to delete memcached key set by another web server -
consider 2 memcached servers, mc1
, mc2
, 2 web servers, web1
, web2
, using php memcached library.
$mc = new memcached(); $mc->addserver(mc1); $mc->addserver(mc2);
from web1
next code executes:
$mc->set('abc', 'val'); // key set mc1
later on, web2
:
$mc->delete('abc');
from understand on how memcached library works, web2
wouldn't know web1
has set key. how can 1 accomplish this?
right i'm iterating through servers , issue delete on each. i'm thinking there might improve way this.
with multiply servers architecture memcached access (set/get/delete) keys on servers based on hash of key. so, yes - web2 not know deleting on web1. not problem in situation. memcache delete key right server placed before.
please read question: using multiple memcache servers in pool
php memcached
Comments
Post a Comment