Optimising use and using multiple memcache servers in a pool

Alan Jay alanj_sw3 at yahoo.co.uk
Fri Jan 19 11:58:34 UTC 2007



And thanks for all your comments.  Having got past the basics and rolled out a
simple implementation I have been trying to work out the advantages of the
simple against the capabilities of the more complex.


In my simple implementation I have 7 web servers each running their own copy
of "memcached" on each server the local php code selects that local memcached
server and checks to see if the article it is loading has been cached.  And
loads it if it has.  The Article Management System when someone edits an
article resets the expire time from 6hrs to 5 seconds on each of the servers
in turn when the article is updated.


This seems to be working OK this morning and we will get more stats over time
but the pecl-memcahced interface has the ability to run multiple servers by
adding and opening them all for selection.  But if (as I am) my script opens a
single file it seems like quite a lot of potential overhead and I'm not sure
what the advantages to doing it like that are.


At present the code already fails safe in that if it is unable to connect to
the local memecached server it just gets the data from mySQL server direct.  


What advantages are there to using the multiple memcached servers added to the
connection pool?


By the way I have been impressed that even with my limited php coding
capabilities that it has only taken a few lines of code to convert from using
mySQL to adding the ability of using memcached.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070119/4fbfa0ef/attachment.html

More information about the memcached mailing list